Class: Trendster::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/trendster/event.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#audienceObject

Returns the value of attribute audience.



5
6
7
# File 'lib/trendster/event.rb', line 5

def audience
  @audience
end

#dateObject

Returns the value of attribute date.



5
6
7
# File 'lib/trendster/event.rb', line 5

def date
  @date
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/trendster/event.rb', line 5

def description
  @description
end

#locationObject

Returns the value of attribute location.



5
6
7
# File 'lib/trendster/event.rb', line 5

def location
  @location
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/trendster/event.rb', line 5

def name
  @name
end

Class Method Details

.allObject



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