Class: Feathr::Config
- Inherits:
-
Object
- Object
- Feathr::Config
- Defined in:
- lib/feathr/config.rb
Constant Summary collapse
- DEFAULT_SCHEME =
'https'
- DEFAULT_HOST =
'staging.qwil.co'
- DEFAULT_API_KEY =
''
Instance Attribute Summary collapse
-
#api_email ⇒ Object
Returns the value of attribute api_email.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_password ⇒ Object
Returns the value of attribute api_password.
-
#host ⇒ Object
Returns the value of attribute host.
-
#scheme ⇒ Object
Returns the value of attribute scheme.
Class Method Summary collapse
Instance Method Summary collapse
- #base_url ⇒ Object
- #configure {|_self| ... } ⇒ Object
-
#initialize {|_self| ... } ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize {|_self| ... } ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 14 15 |
# File 'lib/feathr/config.rb', line 9 def initialize @scheme = DEFAULT_SCHEME @host = DEFAULT_HOST @api_key = DEFAULT_API_KEY yield(self) if block_given? end |
Instance Attribute Details
#api_email ⇒ Object
Returns the value of attribute api_email.
3 4 5 |
# File 'lib/feathr/config.rb', line 3 def api_email @api_email end |
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/feathr/config.rb', line 3 def api_key @api_key end |
#api_password ⇒ Object
Returns the value of attribute api_password.
3 4 5 |
# File 'lib/feathr/config.rb', line 3 def api_password @api_password end |
#host ⇒ Object
Returns the value of attribute host.
3 4 5 |
# File 'lib/feathr/config.rb', line 3 def host @host end |
#scheme ⇒ Object
Returns the value of attribute scheme.
3 4 5 |
# File 'lib/feathr/config.rb', line 3 def scheme @scheme end |
Class Method Details
Instance Method Details
#base_url ⇒ Object
35 36 37 |
# File 'lib/feathr/config.rb', line 35 def base_url url = "#{ scheme }://#{ host }".sub(/\/+\z/, '') end |
#configure {|_self| ... } ⇒ Object
21 22 23 |
# File 'lib/feathr/config.rb', line 21 def configure yield(self) if block_given? end |