Class: Geocodio::UK::District
- Inherits:
-
Object
- Object
- Geocodio::UK::District
- Defined in:
- lib/geocodio/uk/district.rb
Instance Attribute Summary collapse
-
#district_type ⇒ Object
readonly
Returns the value of attribute district_type.
-
#gss_code ⇒ Object
readonly
Returns the value of attribute gss_code.
-
#is_upcoming_district ⇒ Object
readonly
Returns the value of attribute is_upcoming_district.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#nation ⇒ Object
readonly
Returns the value of attribute nation.
-
#ocd_id ⇒ Object
readonly
Returns the value of attribute ocd_id.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(payload = {}) ⇒ District
constructor
A new instance of District.
- #upcoming_district? ⇒ Boolean
Constructor Details
#initialize(payload = {}) ⇒ District
Returns a new instance of District.
7 8 9 10 11 12 13 14 15 |
# File 'lib/geocodio/uk/district.rb', line 7 def initialize(payload = {}) @district_type = payload['district_type'] @gss_code = payload['gss_code'] @ocd_id = payload['ocd_id'] @name = payload['name'] @nation = payload['nation'] @is_upcoming_district = payload['is_upcoming_district'] @source = payload['source'] end |
Instance Attribute Details
#district_type ⇒ Object (readonly)
Returns the value of attribute district_type.
4 5 6 |
# File 'lib/geocodio/uk/district.rb', line 4 def district_type @district_type end |
#gss_code ⇒ Object (readonly)
Returns the value of attribute gss_code.
4 5 6 |
# File 'lib/geocodio/uk/district.rb', line 4 def gss_code @gss_code end |
#is_upcoming_district ⇒ Object (readonly)
Returns the value of attribute is_upcoming_district.
4 5 6 |
# File 'lib/geocodio/uk/district.rb', line 4 def is_upcoming_district @is_upcoming_district end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/geocodio/uk/district.rb', line 4 def name @name end |
#nation ⇒ Object (readonly)
Returns the value of attribute nation.
4 5 6 |
# File 'lib/geocodio/uk/district.rb', line 4 def nation @nation end |
#ocd_id ⇒ Object (readonly)
Returns the value of attribute ocd_id.
4 5 6 |
# File 'lib/geocodio/uk/district.rb', line 4 def ocd_id @ocd_id end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
4 5 6 |
# File 'lib/geocodio/uk/district.rb', line 4 def source @source end |
Instance Method Details
#upcoming_district? ⇒ Boolean
17 18 19 |
# File 'lib/geocodio/uk/district.rb', line 17 def upcoming_district? !!@is_upcoming_district end |