Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Class names in arrays

Reply
Thread Tools

Class names in arrays

 
 
Benjamin Fowl
Guest
Posts: n/a
 
      03-24-2011
Is it a bad idea to use class names in a hash?

eg

coll = [EcoCalendar,MarketForecast]

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Jesús Gabriel y Galán
Guest
Posts: n/a
 
      03-24-2011
On Thu, Mar 24, 2011 at 11:22 AM, Benjamin Fowl <> wrote:
> Is it a bad idea to use class names in a hash?
>
> eg
>
> coll = [EcoCalendar,MarketForecast]


Not per se, depends on what you are going to do with them. By the way,
that's not a hash, it's an array:

ruby-1.8.7-p334 :001 > [String,Time].class
=> Array

Can you give us more information?

Jesus.

 
Reply With Quote
 
 
 
 
Waldemar Dick
Guest
Posts: n/a
 
      03-24-2011
Hi,

Am 24.03.2011 11:22, schrieb Benjamin Fowl:
> Is it a bad idea to use class names in a hash?
>
> eg
>
> coll = [EcoCalendar,MarketForecast]


generally speaking, there is no correct answer for that question. It
depends on your context.
If it fits yours solution, it's absolutely ok.

Waldemar



 
Reply With Quote
 
Robert Klemme
Guest
Posts: n/a
 
      03-24-2011
On Thu, Mar 24, 2011 at 11:22 AM, Benjamin Fowl <> wrote:
> Is it a bad idea to use class names in a hash?
>
> eg
>
> coll = [EcoCalendar,MarketForecast]


Where's the Hash? Or did you mean [EcoCalendar,MarketForecast].hash ?

Cheers

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

 
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
Multidimensional arrays and arrays of arrays Philipp Java 21 01-20-2009 08:33 AM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
Converting 'flat' gate level names to hierarchical names Paddy McCarthy VHDL 3 09-24-2004 05:34 PM
member function names identical to class names Ares Lagae C++ 8 09-24-2004 11:23 AM
table field names vs. display names Bob ASP .Net 1 07-30-2004 05:06 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