Class: Sandy::Provider::ConEd::Report
- Inherits:
-
Object
- Object
- Sandy::Provider::ConEd::Report
- Defined in:
- lib/sandy/providers/coned/report.rb
Instance Attribute Summary collapse
-
#neighborhoods ⇒ Object
readonly
Returns the value of attribute neighborhoods.
-
#regions ⇒ Object
readonly
Returns the value of attribute regions.
Instance Method Summary collapse
-
#initialize ⇒ Report
constructor
A new instance of Report.
Constructor Details
#initialize ⇒ Report
Returns a new instance of Report.
6 7 8 9 10 11 12 13 |
# File 'lib/sandy/providers/coned/report.rb', line 6 def initialize raw_report = JSON.parse(HTTParty.get(coned_url)) area_hash = raw_report.fetch("file_data")["curr_custs_aff"]["areas"].first["areas"] @regions = regions_from_report(area_hash) @neighborhoods = neighborhoods_from_report(area_hash) rescue raise LoadError, "ConEd reponse was not recognizable." end |
Instance Attribute Details
#neighborhoods ⇒ Object (readonly)
Returns the value of attribute neighborhoods.
4 5 6 |
# File 'lib/sandy/providers/coned/report.rb', line 4 def neighborhoods @neighborhoods end |
#regions ⇒ Object (readonly)
Returns the value of attribute regions.
4 5 6 |
# File 'lib/sandy/providers/coned/report.rb', line 4 def regions @regions end |