Class: Geocodio::StateLegislativeDistrict

Inherits:
Object
  • Object
show all
Defined in:
lib/geocodio/state_legislative_district.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload = {}) ⇒ StateLegislativeDistrict

Returns a new instance of StateLegislativeDistrict.


6
7
8
9
10
# File 'lib/geocodio/state_legislative_district.rb', line 6

def initialize(payload = {})
  @name            = payload['name']
  @district_number = payload['district_number'].to_i
  @district_number = payload['district_number'] if @district_number == 0
end

Instance Attribute Details

#district_numberObject

Returns the value of attribute district_number


4
5
6
# File 'lib/geocodio/state_legislative_district.rb', line 4

def district_number
  @district_number
end

#nameObject

Returns the value of attribute name


3
4
5
# File 'lib/geocodio/state_legislative_district.rb', line 3

def name
  @name
end