Class: Jpzip::ZipcodeEntry
- Inherits:
-
Data
- Object
- Data
- Jpzip::ZipcodeEntry
- Defined in:
- lib/jpzip/types.rb
Overview
ZipcodeEntry is one logical entry as published by the CDN.
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#city_code ⇒ Object
readonly
Returns the value of attribute city_code.
-
#city_kana ⇒ Object
readonly
Returns the value of attribute city_kana.
-
#city_roma ⇒ Object
readonly
Returns the value of attribute city_roma.
-
#prefecture ⇒ Object
readonly
Returns the value of attribute prefecture.
-
#prefecture_code ⇒ Object
readonly
Returns the value of attribute prefecture_code.
-
#prefecture_kana ⇒ Object
readonly
Returns the value of attribute prefecture_kana.
-
#prefecture_roma ⇒ Object
readonly
Returns the value of attribute prefecture_roma.
-
#towns ⇒ Object
readonly
Returns the value of attribute towns.
Class Method Summary collapse
Instance Attribute Details
#city ⇒ Object (readonly)
Returns the value of attribute city
27 28 29 |
# File 'lib/jpzip/types.rb', line 27 def city @city end |
#city_code ⇒ Object (readonly)
Returns the value of attribute city_code
27 28 29 |
# File 'lib/jpzip/types.rb', line 27 def city_code @city_code end |
#city_kana ⇒ Object (readonly)
Returns the value of attribute city_kana
27 28 29 |
# File 'lib/jpzip/types.rb', line 27 def city_kana @city_kana end |
#city_roma ⇒ Object (readonly)
Returns the value of attribute city_roma
27 28 29 |
# File 'lib/jpzip/types.rb', line 27 def city_roma @city_roma end |
#prefecture ⇒ Object (readonly)
Returns the value of attribute prefecture
27 28 29 |
# File 'lib/jpzip/types.rb', line 27 def prefecture @prefecture end |
#prefecture_code ⇒ Object (readonly)
Returns the value of attribute prefecture_code
27 28 29 |
# File 'lib/jpzip/types.rb', line 27 def prefecture_code @prefecture_code end |
#prefecture_kana ⇒ Object (readonly)
Returns the value of attribute prefecture_kana
27 28 29 |
# File 'lib/jpzip/types.rb', line 27 def prefecture_kana @prefecture_kana end |
#prefecture_roma ⇒ Object (readonly)
Returns the value of attribute prefecture_roma
27 28 29 |
# File 'lib/jpzip/types.rb', line 27 def prefecture_roma @prefecture_roma end |
#towns ⇒ Object (readonly)
Returns the value of attribute towns
27 28 29 |
# File 'lib/jpzip/types.rb', line 27 def towns @towns end |
Class Method Details
.from_hash(h) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/jpzip/types.rb', line 38 def self.from_hash(h) new( prefecture: h["prefecture"] || "", prefecture_kana: h["prefecture_kana"] || "", prefecture_roma: h["prefecture_roma"] || "", prefecture_code: h["prefecture_code"] || "", city: h["city"] || "", city_kana: h["city_kana"] || "", city_roma: h["city_roma"] || "", city_code: h["city_code"] || "", towns: (h["towns"] || []).map { |t| Town.from_hash(t) } ) end |