lib/peddler/marketplace.rb in peddler-0.12.7 vs lib/peddler/marketplace.rb in peddler-0.13.0
- old
+ new
@@ -17,11 +17,11 @@
BadId = Class.new(StandardError)
attr_reader :id
def initialize(id)
- @id = id
+ @id = id or fail BadId, 'missing MarketplaceId'
end
def host
@host ||= find_host
end
@@ -39,10 +39,10 @@
end
private
def find_host
- HOSTS.fetch(id) { raise BadId }
+ HOSTS.fetch(id) { fail BadId, %Q("#{id}" is not a valid MarketplaceId) }
end
def japanese?
host.end_with?('jp')
end