Class: Yuso::Yubin::ShippingFee

Inherits:
Object
  • Object
show all
Defined in:
lib/yuso/yubin/shipping_fee.rb

Class Method Summary collapse

Class Method Details

.load(prefecture_name) ⇒ Object



7
8
9
10
11
# File 'lib/yuso/yubin/shipping_fee.rb', line 7

def self.load(prefecture_name)
  area = mapping.fetch(prefecture_name) { raise ArgumentError, 'Prefecture name is not correct.' }
  json_path = Yuso::DATA_PATH + "/yubin/#{area}.json"
  JSON.load(File.read(json_path))
end