Module: Fyb::Configuration
- Defined in:
- lib/fyb/configuration.rb
Overview
Configuration class that sets the default values if needed. Call this using:
Fyb::Configuration.configure do |config|
config.currency = :sek
config.key = 'your-fyb-key'
config.sig = 'your-fyb-secret'
end
Constant Summary collapse
- APIS =
{ sek: 'https://www.fybse.se/api/SEK/', sgd: 'https://www.fybsg.com/api/SGD/', test: 'https://fyb.apiary.io/' }
Class Attribute Summary collapse
-
.currency ⇒ Object
Returns the value of attribute currency.
-
.key ⇒ Object
Returns the value of attribute key.
-
.sig ⇒ Object
Returns the value of attribute sig.
Class Method Summary collapse
Class Attribute Details
.currency ⇒ Object
Returns the value of attribute currency.
13 14 15 |
# File 'lib/fyb/configuration.rb', line 13 def currency @currency end |
.key ⇒ Object
Returns the value of attribute key.
13 14 15 |
# File 'lib/fyb/configuration.rb', line 13 def key @key end |
.sig ⇒ Object
Returns the value of attribute sig.
13 14 15 |
# File 'lib/fyb/configuration.rb', line 13 def sig @sig end |
Class Method Details
.configure {|_self| ... } ⇒ Object
32 33 34 |
# File 'lib/fyb/configuration.rb', line 32 def configure yield self end |
.domain ⇒ Object
26 27 28 29 30 |
# File 'lib/fyb/configuration.rb', line 26 def domain return APIS[:sek] if currency.nil? APIS[currency] end |