Module: EcwidGateway::Config
- Included in:
- EcwidGateway
- Defined in:
- lib/ecwid_gateway/config.rb
Constant Summary collapse
- DEFAULT_API_DOMAIN =
Defaultapi domain
'http://127.0.0.1:80'
- DEFAULT_STORE_ID =
Defailt api token
nil
- VALID_OPTIONS_KEYS =
Valid options keys
[ :store_id, :api_domain, :order_secure_auth_key, :sso_secure_auth_key ]
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
-
#options ⇒ Hash
Create a hash of options and their values.
-
#reset ⇒ self
Reset config.
Class Method Details
.extended(base) ⇒ Object
21 22 23 |
# File 'lib/ecwid_gateway/config.rb', line 21 def self.extended(base) base.reset end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
25 26 27 28 |
# File 'lib/ecwid_gateway/config.rb', line 25 def configure yield self self end |
#options ⇒ Hash
Create a hash of options and their values
33 34 35 36 37 |
# File 'lib/ecwid_gateway/config.rb', line 33 def = {} VALID_OPTIONS_KEYS.each{|k| [k] = send(k)} end |
#reset ⇒ self
Reset config
42 43 44 45 46 |
# File 'lib/ecwid_gateway/config.rb', line 42 def reset self.store_id = DEFAULT_STORE_ID self.api_domain = DEFAULT_API_DOMAIN self end |