Class: Peddler::Marketplace Private
- Inherits:
-
Struct
- Object
- Struct
- Peddler::Marketplace
- Defined in:
- lib/peddler/marketplace.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class Attribute Summary collapse
- .all ⇒ Object readonly private
Instance Attribute Summary collapse
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#host ⇒ Object
Returns the value of attribute host.
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
- .find(id) ⇒ Object private
Instance Method Summary collapse
-
#encoding ⇒ Object
private
Caveat: We use the supersets Windows-31J and CP1252 in place of Shift_JIS and ISO 8859-1 respectively to handle edge cases where latter will not support some characters.
Class Attribute Details
.all ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/peddler/marketplace.rb', line 8 def all @all end |
Instance Attribute Details
#country_code ⇒ Object
Returns the value of attribute country_code
6 7 8 |
# File 'lib/peddler/marketplace.rb', line 6 def country_code @country_code end |
#host ⇒ Object
Returns the value of attribute host
6 7 8 |
# File 'lib/peddler/marketplace.rb', line 6 def host @host end |
#id ⇒ Object
Returns the value of attribute id
6 7 8 |
# File 'lib/peddler/marketplace.rb', line 6 def id @id end |
Class Method Details
.find(id) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/peddler/marketplace.rb', line 10 def find(id) all.find { |marketplace| marketplace.id == id } || begin = if id %("#{id}" is not a valid MarketplaceId) else 'missing MarketplaceId' end raise ArgumentError, end end |
Instance Method Details
#encoding ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Caveat: We use the supersets Windows-31J and CP1252 in place of Shift_JIS and ISO 8859-1 respectively to handle edge cases where latter will not support some characters. The supersets should be safe to use as drop-in replacements.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/peddler/marketplace.rb', line 27 def encoding case country_code when 'JP' 'Windows-31J' when 'CN' 'UTF-16' else 'CP1252' end end |