Class: Trendster::Event
- Inherits:
-
Object
- Object
- Trendster::Event
- Defined in:
- lib/trendster/event.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#audience ⇒ Object
Returns the value of attribute audience.
-
#date ⇒ Object
Returns the value of attribute date.
-
#description ⇒ Object
Returns the value of attribute description.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(event_hash) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(event_hash) ⇒ Event
11 12 13 14 |
# File 'lib/trendster/event.rb', line 11 def initialize(event_hash) event_hash.each {|k,v| self.send(("#{k}="), v)} @@all << self end |
Instance Attribute Details
#audience ⇒ Object
Returns the value of attribute audience.
5 6 7 |
# File 'lib/trendster/event.rb', line 5 def audience @audience end |
#date ⇒ Object
Returns the value of attribute date.
5 6 7 |
# File 'lib/trendster/event.rb', line 5 def date @date end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/trendster/event.rb', line 5 def description @description end |
#location ⇒ Object
Returns the value of attribute location.
5 6 7 |
# File 'lib/trendster/event.rb', line 5 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/trendster/event.rb', line 5 def name @name end |
Class Method Details
.all ⇒ Object
16 17 18 |
# File 'lib/trendster/event.rb', line 16 def self.all @@all end |
.create_from_collection(events_array) ⇒ Object
20 21 22 23 24 |
# File 'lib/trendster/event.rb', line 20 def self.create_from_collection(events_array) events_array.each do |event_hash| self.new(event_hash) end end |