Class: MeetupScraper::Event
- Inherits:
-
Object
- Object
- MeetupScraper::Event
- Defined in:
- lib/meetup_scraper/event.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#date ⇒ Object
Returns the value of attribute date.
-
#description ⇒ Object
Returns the value of attribute description.
-
#num_attending ⇒ Object
Returns the value of attribute num_attending.
-
#organiser ⇒ Object
Returns the value of attribute organiser.
-
#time ⇒ Object
Returns the value of attribute time.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
2 3 4 |
# File 'lib/meetup_scraper/event.rb', line 2 def address @address end |
#date ⇒ Object
Returns the value of attribute date.
2 3 4 |
# File 'lib/meetup_scraper/event.rb', line 2 def date @date end |
#description ⇒ Object
Returns the value of attribute description.
2 3 4 |
# File 'lib/meetup_scraper/event.rb', line 2 def description @description end |
#num_attending ⇒ Object
Returns the value of attribute num_attending.
2 3 4 |
# File 'lib/meetup_scraper/event.rb', line 2 def num_attending @num_attending end |
#organiser ⇒ Object
Returns the value of attribute organiser.
2 3 4 |
# File 'lib/meetup_scraper/event.rb', line 2 def organiser @organiser end |
#time ⇒ Object
Returns the value of attribute time.
2 3 4 |
# File 'lib/meetup_scraper/event.rb', line 2 def time @time end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/meetup_scraper/event.rb', line 2 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/meetup_scraper/event.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
18 19 20 |
# File 'lib/meetup_scraper/event.rb', line 18 def self.all @@all end |
.create_from_collection(event_hashes) ⇒ Object
13 14 15 16 |
# File 'lib/meetup_scraper/event.rb', line 13 def self.create_from_collection(event_hashes) self.all.clear event_hashes.collect {|event_hash| self.new.create_from_hash(event_hash)} end |
Instance Method Details
#create_from_hash(event_hash) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/meetup_scraper/event.rb', line 5 def create_from_hash(event_hash) event_hash.each do |k, v| self.send("#{k}=", v) end save self end |
#save ⇒ Object
22 23 24 |
# File 'lib/meetup_scraper/event.rb', line 22 def save self.class.all << self end |
#update_event_attributes(event_hash) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/meetup_scraper/event.rb', line 26 def update_event_attributes(event_hash) event_hash.each do |k, v| self.send("#{k}=", v) end self end |