Class names in arrays

Is it a bad idea to use class names in a hash?

eg

coll = [EcoCalendar,MarketForecast]

On Thu, Mar 24, 2011 at 11:22 AM, Benjamin F. [email protected]
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.

Hi,

Am 24.03.2011 11:22, schrieb Benjamin F.:

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

On Thu, Mar 24, 2011 at 11:22 AM, Benjamin F. [email protected]
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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs