Class: Sandy::Provider::LIPA::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/sandy/providers/lipa/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/lipa/report.rb', line 6

def initialize
  raw_report = HTTParty.get(lipa_url, format: :xml)
  area_hash = raw_report.fetch("root").fetch("curr_custs_aff")["areas"]["area"]["areas"].first[1]
  @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/lipa/report.rb', line 4

def neighborhoods
  @neighborhoods
end

#regionsObject (readonly)

Returns the value of attribute regions.



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

def regions
  @regions
end