Module: Geocodio::UK
- Included in:
- Address
- Defined in:
- lib/geocodio/uk.rb,
lib/geocodio/uk/district.rb
Defined Under Namespace
Classes: District
Instance Attribute Summary collapse
-
#uk_devolved ⇒ Object
readonly
Returns the value of attribute uk_devolved.
-
#uk_local ⇒ Object
readonly
Returns the value of attribute uk_local.
-
#uk_westminster ⇒ Object
readonly
Returns the value of attribute uk_westminster.
Instance Method Summary collapse
Instance Attribute Details
#uk_devolved ⇒ Object (readonly)
Returns the value of attribute uk_devolved.
5 6 7 |
# File 'lib/geocodio/uk.rb', line 5 def uk_devolved @uk_devolved end |
#uk_local ⇒ Object (readonly)
Returns the value of attribute uk_local.
5 6 7 |
# File 'lib/geocodio/uk.rb', line 5 def uk_local @uk_local end |
#uk_westminster ⇒ Object (readonly)
Returns the value of attribute uk_westminster.
5 6 7 |
# File 'lib/geocodio/uk.rb', line 5 def uk_westminster @uk_westminster end |
Instance Method Details
#set_uk_fields(fields) ⇒ Object
7 8 9 10 11 |
# File 'lib/geocodio/uk.rb', line 7 def set_uk_fields(fields) @uk_westminster = Array(fields['uk_westminster']).map { |d| UK::District.new(d) } @uk_devolved = Array(fields['uk_devolved']).map { |d| UK::District.new(d) } @uk_local = Array(fields['uk_local']).map { |d| UK::District.new(d) } end |
#uk? ⇒ Boolean
17 18 19 |
# File 'lib/geocodio/uk.rb', line 17 def uk? !!(@uk_westminster || @uk_devolved || @uk_local) end |
#uk_fields?(fields) ⇒ Boolean
13 14 15 |
# File 'lib/geocodio/uk.rb', line 13 def uk_fields?(fields) fields.key?('uk_westminster') || fields.key?('uk_devolved') || fields.key?('uk_local') end |