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(key) ⇒ Object private
Instance Method Summary collapse
-
#encoding ⇒ Object
private
Caveat: We use supersets Windows-31J and CP1252 in place of Shift_JIS and ISO 8859-1 respectively to handle some edge cases.
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(key) ⇒ 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(key) marketplace = if key.nil? missing_key! elsif key.size == 2 find_by_country_code(key) else find_by_id(key) end marketplace || not_found!(key) 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 supersets Windows-31J and CP1252 in place of Shift_JIS and ISO 8859-1 respectively to handle some edge cases. These should be safe to drop in as replacements.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/peddler/marketplace.rb', line 45 def encoding case country_code when 'JP' 'Windows-31J' when 'CN' 'UTF-16' else 'CP1252' end end |