Class: JapaneseAddressParser::Models::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/japanese_address_parser/models/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(full_address:, prefecture:, city:, town:) ⇒ Address

Returns a new instance of Address.



8
9
10
11
12
13
# File 'lib/japanese_address_parser/models/address.rb', line 8

def initialize(full_address:, prefecture:, city:, town:)
  @full_address = full_address
  @prefecture = prefecture
  @city = city
  @town = town
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.



6
7
8
# File 'lib/japanese_address_parser/models/address.rb', line 6

def city
  @city
end

#full_addressObject (readonly)

Returns the value of attribute full_address.



6
7
8
# File 'lib/japanese_address_parser/models/address.rb', line 6

def full_address
  @full_address
end

#prefectureObject (readonly)

Returns the value of attribute prefecture.



6
7
8
# File 'lib/japanese_address_parser/models/address.rb', line 6

def prefecture
  @prefecture
end

#townObject (readonly)

Returns the value of attribute town.



6
7
8
# File 'lib/japanese_address_parser/models/address.rb', line 6

def town
  @town
end

Instance Method Details

#furiganaObject



15
16
17
# File 'lib/japanese_address_parser/models/address.rb', line 15

def furigana
  "#{prefecture&.name_kana}#{city&.name_kana}#{town&.name_kana}"
end