class PecCalcClient::Region

Constants

URL

Attributes

name[R]
towns[R]

Public Class Methods

all() click to toggle source
# File lib/pec_calc_client/region.rb, line 12
def self.all
  @all = Connector.new(self::URL).request.to_hash.collect { |name, towns| new name, towns } if @all.nil?
  @all
end
new(name, towns) click to toggle source
# File lib/pec_calc_client/region.rb, line 7
def initialize(name, towns)
  @name = name
  @towns = towns.collect { |id, name| Town.new id, name }
end