Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > replace my symbolobject

Reply
Thread Tools

replace my symbolobject

 
 
Junkone
Guest
Posts: n/a
 
      08-11-2006
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,therInf o,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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace /n with a XHTML <br /> using string.replace Alun ASP .Net 3 02-18-2008 05:52 AM
Re: [Pyrex] pyrex functions to replace a method (Re: replace a method Greg Ewing Python 2 06-29-2006 05:25 PM
pyrex functions to replace a method (Re: replace a method in class:how?) Brian Blais Python 1 06-27-2006 12:13 PM
s/$match/$replace/ fails when $replace has backreferences anonyusenet@yahoo.com Perl Misc 3 09-12-2005 11:03 AM
help with string replace - for doing selective replace Prasad S Javascript 2 08-27-2004 03:22 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57