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

Returns a new instance of Event.



9
10
11
12
# File 'lib/trendster/event.rb', line 9

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.



3
4
5
# File 'lib/trendster/event.rb', line 3

def audience
  @audience
end

#dateObject

Returns the value of attribute date.



3
4
5
# File 'lib/trendster/event.rb', line 3

def date
  @date
end

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/trendster/event.rb', line 3

def description
  @description
end

#locationObject

Returns the value of attribute location.



3
4
5
# File 'lib/trendster/event.rb', line 3

def location
  @location
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/trendster/event.rb', line 3

def name
  @name
end

Class Method Details

.allObject



14
15
16
# File 'lib/trendster/event.rb', line 14

def self.all
  @@all
end

.create_from_collection(events_array) ⇒ Object



18
19
20
21
22
23
# File 'lib/trendster/event.rb', line 18

def self.create_from_collection(events_array)

  events_array.each do |event_hash|
    self.new(event_hash)
  end
end