Class: UtahCountyAaMeetingFinder::Meetings
- Inherits:
-
Object
- Object
- UtahCountyAaMeetingFinder::Meetings
- Defined in:
- lib/utah_county_aa_meeting_finder/meetings.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.
-
#name ⇒ Object
Returns the value of attribute name.
-
#time ⇒ Object
Returns the value of attribute time.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name = nil, date = nil, address = nil, time = nil) ⇒ Meetings
constructor
A new instance of Meetings.
Constructor Details
#initialize(name = nil, date = nil, address = nil, time = nil) ⇒ Meetings
Returns a new instance of Meetings.
12 13 14 15 16 17 18 |
# File 'lib/utah_county_aa_meeting_finder/meetings.rb', line 12 def initialize(name = nil, date = nil, address = nil, time = nil) @name =name @date = date @address = address @time = time @@all<<self end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
2 3 4 |
# File 'lib/utah_county_aa_meeting_finder/meetings.rb', line 2 def address @address end |
#date ⇒ Object
Returns the value of attribute date.
2 3 4 |
# File 'lib/utah_county_aa_meeting_finder/meetings.rb', line 2 def date @date end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/utah_county_aa_meeting_finder/meetings.rb', line 2 def name @name end |
#time ⇒ Object
Returns the value of attribute time.
2 3 4 |
# File 'lib/utah_county_aa_meeting_finder/meetings.rb', line 2 def time @time end |
Class Method Details
.all ⇒ Object
26 27 28 |
# File 'lib/utah_county_aa_meeting_finder/meetings.rb', line 26 def self.all @@all end |
.find_by_day(day) ⇒ Object
20 21 22 23 24 |
# File 'lib/utah_county_aa_meeting_finder/meetings.rb', line 20 def self.find_by_day(day) all.select do |meeting| meeting.date.downcase == day.downcase end end |
.new_meetings(meeting) ⇒ Object
6 7 8 9 10 |
# File 'lib/utah_county_aa_meeting_finder/meetings.rb', line 6 def self.new_meetings(meeting) if meeting.css(".groupmtgsm").text != "" new = self.new(meeting.css(".groupmtgsm").text, meeting.css(".day u").text, meeting.css(".marq a").attribute('href').text, meeting.css(".day").text.split("\n")[1]) end end |