Class: JapaneseAddressParser::Config
- Inherits:
-
Object
- Object
- JapaneseAddressParser::Config
- Defined in:
- lib/japanese_address_parser/config.rb,
sig/config.rbs
Overview
JS の config.ts。currentConfig(可変シングルトン)に対応する設定オブジェクト。 japanese_addresses_api / cache_size / geolonia_api_key を保持する。
Constant Summary collapse
- DEFAULT_ENDPOINT =
JS: defaultEndpoint — 末尾スラッシュ無し(fetch 側で
${api}${input}と連結する)。 'https://japanese-addresses-v2.geoloniamaps.com/api/ja'
Instance Attribute Summary collapse
-
#cache_size ⇒ Integer
JS: japaneseAddressesApi / cacheSize / geoloniaApiKey.
-
#geolonia_api_key ⇒ String?
JS: japaneseAddressesApi / cacheSize / geoloniaApiKey.
-
#japanese_addresses_api ⇒ String
JS: japaneseAddressesApi / cacheSize / geoloniaApiKey.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
JS: currentConfig = { japaneseAddressesApi: defaultEndpoint, cacheSize: 1_000 }.
Constructor Details
#initialize ⇒ Config
JS: currentConfig = { japaneseAddressesApi: defaultEndpoint, cacheSize: 1_000 }
20 21 22 23 24 |
# File 'lib/japanese_address_parser/config.rb', line 20 def initialize @japanese_addresses_api = DEFAULT_ENDPOINT @cache_size = 1_000 @geolonia_api_key = nil end |
Instance Attribute Details
#cache_size ⇒ Integer
JS: japaneseAddressesApi / cacheSize / geoloniaApiKey
17 18 19 |
# File 'lib/japanese_address_parser/config.rb', line 17 def cache_size @cache_size end |
#geolonia_api_key ⇒ String?
JS: japaneseAddressesApi / cacheSize / geoloniaApiKey
17 18 19 |
# File 'lib/japanese_address_parser/config.rb', line 17 def geolonia_api_key @geolonia_api_key end |
#japanese_addresses_api ⇒ String
JS: japaneseAddressesApi / cacheSize / geoloniaApiKey
17 18 19 |
# File 'lib/japanese_address_parser/config.rb', line 17 def japanese_addresses_api @japanese_addresses_api end |