Class: Ean::API
- Inherits:
-
Object
- Object
- Ean::API
- Defined in:
- lib/ean/api.rb
Constant Summary collapse
- @@instance =
nil
Instance Attribute Summary collapse
-
#cid ⇒ Object
Returns the value of attribute cid.
-
#currency_code ⇒ Object
Returns the value of attribute currency_code.
-
#customer_ip_address ⇒ Object
Returns the value of attribute customer_ip_address.
-
#customer_session_id ⇒ Object
Returns the value of attribute customer_session_id.
-
#customer_user_agent ⇒ Object
Returns the value of attribute customer_user_agent.
-
#key ⇒ Object
Returns the value of attribute key.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#minor_rev ⇒ Object
Returns the value of attribute minor_rev.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#sig ⇒ Object
Returns the value of attribute sig.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Attribute Details
#cid ⇒ Object
Returns the value of attribute cid.
3 4 5 |
# File 'lib/ean/api.rb', line 3 def cid @cid end |
#currency_code ⇒ Object
Returns the value of attribute currency_code.
3 4 5 |
# File 'lib/ean/api.rb', line 3 def currency_code @currency_code end |
#customer_ip_address ⇒ Object
Returns the value of attribute customer_ip_address.
3 4 5 |
# File 'lib/ean/api.rb', line 3 def customer_ip_address @customer_ip_address end |
#customer_session_id ⇒ Object
Returns the value of attribute customer_session_id.
3 4 5 |
# File 'lib/ean/api.rb', line 3 def customer_session_id @customer_session_id end |
#customer_user_agent ⇒ Object
Returns the value of attribute customer_user_agent.
3 4 5 |
# File 'lib/ean/api.rb', line 3 def customer_user_agent @customer_user_agent end |
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/ean/api.rb', line 3 def key @key end |
#locale ⇒ Object
Returns the value of attribute locale.
3 4 5 |
# File 'lib/ean/api.rb', line 3 def locale @locale end |
#minor_rev ⇒ Object
Returns the value of attribute minor_rev.
3 4 5 |
# File 'lib/ean/api.rb', line 3 def minor_rev @minor_rev end |
#secret ⇒ Object
Returns the value of attribute secret.
3 4 5 |
# File 'lib/ean/api.rb', line 3 def secret @secret end |
#sig ⇒ Object
Returns the value of attribute sig.
3 4 5 |
# File 'lib/ean/api.rb', line 3 def sig @sig end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/ean/api.rb', line 3 def version @version end |
Class Method Details
.instance ⇒ Object
29 30 31 |
# File 'lib/ean/api.rb', line 29 def self.instance @@instance end |
.make(cid, key, secret, params = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ean/api.rb', line 17 def self.make(cid, key, secret, params={}) @@instance = self.new @@instance.cid = cid @@instance.key = key @@instance.sig = params[:sig].present? ? params[:sig] : "" @@instance.secret = secret @@instance.version = params[:version].present? ? params[:version] : "3" @@instance.locale = params[:locale].present? ? params[:locale] : "en_US" @@instance.minor_rev = params[:minor_rev].present? ? params[:minor_rev] : "4" @@instance.currency_code = params[:currency_code].present? ? params[:currency_code] : "USD" end |