Class: Sandy::Provider::ConEd::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/sandy/providers/coned/report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReport

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

#neighborhoodsObject (readonly)

Returns the value of attribute neighborhoods.



4
5
6
# File 'lib/sandy/providers/coned/report.rb', line 4

def neighborhoods
  @neighborhoods
end

#regionsObject (readonly)

Returns the value of attribute regions.



4
5
6
# File 'lib/sandy/providers/coned/report.rb', line 4

def regions
  @regions
end