Class: JpPrefecture::Prefecture::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/jp_prefecture/prefecture/finder.rb

Overview

都道府県の検索を行うクラス

Instance Method Summary collapse

Constructor Details

#initializeFinder



10
11
12
# File 'lib/jp_prefecture/prefecture/finder.rb', line 10

def initialize
  @mapping = Mapping.data
end

Instance Method Details

#find(field:, value:) ⇒ JpPrefecture::Prefecture?

指定した項目を検索



20
21
22
23
# File 'lib/jp_prefecture/prefecture/finder.rb', line 20

def find(field:, value:)
  code = find_code(field, value)
  JpPrefecture::Prefecture.build_by_code(code)
end