Class: WeatherGov::Identifier::Gridpoint

Inherits:
WeatherGov::Identifier show all
Defined in:
lib/weather_gov/identifier/gridpoint.rb

Constant Summary

Constants inherited from WeatherGov::Identifier

TYPES

Instance Attribute Summary

Attributes inherited from WeatherGov::Identifier

#uri

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from WeatherGov::Identifier

#id, #initialize, parse, #to_s

Constructor Details

This class inherits a constructor from WeatherGov::Identifier

Class Method Details

.base_uriObject



8
9
10
# File 'lib/weather_gov/identifier/gridpoint.rb', line 8

def self.base_uri
  URI.join(super, "/gridpoints/").to_s
end

Instance Method Details

#grid_idObject



16
17
18
# File 'lib/weather_gov/identifier/gridpoint.rb', line 16

def grid_id
  @grid_id ||= id.split("/")[1]
end

#grid_xObject



20
21
22
# File 'lib/weather_gov/identifier/gridpoint.rb', line 20

def grid_x
  @grid_x ||= grid_id.split(",")[0]
end

#grid_yObject



24
25
26
# File 'lib/weather_gov/identifier/gridpoint.rb', line 24

def grid_y
  @grid_y ||= grid_id.split(",")[1]
end

#office_idObject



12
13
14
# File 'lib/weather_gov/identifier/gridpoint.rb', line 12

def office_id
  @office_id ||= id.split("/")[0]
end