Class: Hobos::Api
- Inherits:
-
Object
- Object
- Hobos::Api
- Defined in:
- lib/hobos.rb
Instance Method Summary collapse
- #hobo ⇒ Object
- #hobo_by_id(id) ⇒ Object
-
#initialize ⇒ Api
constructor
A new instance of Api.
Constructor Details
#initialize ⇒ Api
Returns a new instance of Api.
5 6 7 |
# File 'lib/hobos.rb', line 5 def initialize @browser = Browser.new.browser end |
Instance Method Details
#hobo ⇒ Object
9 10 11 |
# File 'lib/hobos.rb', line 9 def hobo clean_name(try_hobo(false)) end |
#hobo_by_id(id) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/hobos.rb', line 13 def hobo_by_id id begin clean_name(@browser.get("#{HOBOS_URL}#{id}").at('span').children.last.to_s) rescue '' end end |