replace my symbolobject

Discussion in 'Ruby' started by Junkone, Aug 11, 2006.

  1. Junkone

    Junkone Guest

    I havea symbolobject which i use as a array later. the definition is
    class SymbolObject

    def initialize(symb)
    puts symb
    @symbol=symb

    @name=@exchange=@news=@summary=@sector=@industry=@category=@otherInfo=@optionsData=@scanType=@scLink=''
    @markedBad=false
    end
    attr_accessor :symbol,:name ,:exchange, :news, :summary, :sector,
    :industry,:category,:markedBad,:scanType,:eek:therInfo,:eek:ptionsData,:scLink;
    def to_s
    return @symbol + @news + @exchange + @name
    end
    def <=>(other)
    return [@symb, @name, @exchange] <=> [other.symb, other.name,
    other.exchange]
    end


    end

    Issuethat i see
    1. As i create a symbol object, i add it to a array. However i have no
    means of sorting the symbol objects based on its properties or use
    indexed seeks etc.
    2. how to i either enhance the symbolobject or replace it with
    somethingelse that provides a object like view but can be indexed and
    sorted. Is there a collection object or Record object in ruby. i am
    open for any other options.
    Junkone, Aug 11, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Blais
    Replies:
    1
    Views:
    365
    Bruno Desthuilliers
    Jun 27, 2006
  2. Greg Ewing
    Replies:
    2
    Views:
    331
    Dieter Maurer
    Jun 29, 2006
  3. Alun
    Replies:
    3
    Views:
    4,475
    Masudur
    Feb 18, 2008
  4. Prasad S
    Replies:
    2
    Views:
    214
    Dr John Stockton
    Aug 27, 2004
  5. Replies:
    3
    Views:
    168
    Brian McCauley
    Sep 12, 2005
Loading...

Share This Page