Class: LaundryView::Sync
- Inherits:
-
Object
- Object
- LaundryView::Sync
- Includes:
- Enumerable
- Defined in:
- lib/laundryview/main.rb
Constant Summary collapse
- WINDSOR =
185842
Instance Method Summary collapse
- #count ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(room) ⇒ Sync
constructor
A new instance of Sync.
- #update ⇒ Object
Constructor Details
#initialize(room) ⇒ Sync
9 10 11 12 13 14 15 16 17 |
# File 'lib/laundryview/main.rb', line 9 def initialize room @room = room @agent = Curl::Easy.new "http://laundryview.com/laundry_room.php?lr=#{@room}" @agent.follow_location = true @agent. = true @agent.perform self.update nil end |
Instance Method Details
#count ⇒ Object
25 26 27 |
# File 'lib/laundryview/main.rb', line 25 def count @machines.count end |
#each(&block) ⇒ Object
29 30 31 |
# File 'lib/laundryview/main.rb', line 29 def each &block @machines.each &block end |
#update ⇒ Object
19 20 21 22 23 |
# File 'lib/laundryview/main.rb', line 19 def update @agent.url = "http://laundryview.com/classic_laundry_room_ajax.php?lr=#{@room}" @agent.perform @machines = parse_body @agent.body_str end |