replace my symbolobject

J

Junkone

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top