# Replace my symbolobject

**URL:** <https://www.ruby-forum.com/t/replace-my-symbolobject/102403>\
**Category:** Ruby\
**Created:** [August 15, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/replace-my-symbolobject/102403 "2006-08-15T14:16:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [August 15, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/replace-my-symbolobject/102403/1 "2006-08-15T14:16:43Z")

</div>

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,:otherInfo,:optionsData,: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.
