Class: Sandy::Provider::PSEG::Report

Inherits:
Object
  • Object
show all
Includes:
CoordinateCache
Defined in:
lib/sandy/providers/pseg/report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CoordinateCache

#cached_coordinates_for, #gps_data

Constructor Details

#initializeReport

Returns a new instance of Report.



10
11
12
13
14
15
16
17
18
19
# File 'lib/sandy/providers/pseg/report.rb', line 10

def initialize
  parser = XML::Parser.new
  parser.string = HTTParty.get(pseg_url).to_s
  raw_report = parser.parse

  @areas = parse raw_report
  
rescue
  raise LoadError, "PSEG response was not recognizable."
end

Instance Attribute Details

#areasObject (readonly)

Returns the value of attribute areas.



8
9
10
# File 'lib/sandy/providers/pseg/report.rb', line 8

def areas
  @areas
end