Class: Wapi::Report
- Inherits:
-
Object
- Object
- Wapi::Report
- Defined in:
- lib/wapi.rb
Constant Summary collapse
- WAVES_URL =
'http://waves.terra.com.br/surf/ondas'
Instance Attribute Summary collapse
-
#html ⇒ Object
readonly
Returns the value of attribute html.
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(beach, url = WAVES_URL) ⇒ Report
constructor
A new instance of Report.
Constructor Details
#initialize(beach, url = WAVES_URL) ⇒ Report
Returns a new instance of Report.
13 14 15 16 |
# File 'lib/wapi.rb', line 13 def initialize(beach, url=WAVES_URL) beach_url = "#{url}#{beach}" @html = Nokogiri::HTML(open(beach_url)) end |
Instance Attribute Details
#html ⇒ Object (readonly)
Returns the value of attribute html.
9 10 11 |
# File 'lib/wapi.rb', line 9 def html @html end |
Instance Method Details
#check ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/wapi.rb', line 18 def check conditions = {} ConditionParser::constants.each do |constant| conditions[constant.downcase] = ConditionParser.const_get(constant).extract(@html) end conditions end |