Class: Little::Configuration
- Inherits:
-
Object
- Object
- Little::Configuration
- Defined in:
- lib/little/configuration.rb
Constant Summary collapse
- OPTIONS =
[ :api_key, :api_secret, :host, :port, :secure, :http_open_timeout, :http_read_timeout, :proxy_host, :proxy_pass, :proxy_port, :proxy_user].freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_secret ⇒ Object
Returns the value of attribute api_secret.
-
#host ⇒ Object
Returns the value of attribute host.
-
#http_open_timeout ⇒ Object
Returns the value of attribute http_open_timeout.
-
#http_read_timeout ⇒ Object
Returns the value of attribute http_read_timeout.
-
#proxy_host ⇒ Object
Returns the value of attribute proxy_host.
-
#proxy_pass ⇒ Object
Returns the value of attribute proxy_pass.
-
#proxy_port ⇒ Object
Returns the value of attribute proxy_port.
-
#proxy_user ⇒ Object
Returns the value of attribute proxy_user.
-
#secure ⇒ Object
Returns the value of attribute secure.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #port ⇒ Object
- #port=(value) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
21 22 23 24 25 26 |
# File 'lib/little/configuration.rb', line 21 def initialize @secure = true @host = 'api.little.io' @http_open_timeout = 5 @http_read_timeout = 5 end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/little/configuration.rb', line 9 def api_key @api_key end |
#api_secret ⇒ Object
Returns the value of attribute api_secret.
9 10 11 |
# File 'lib/little/configuration.rb', line 9 def api_secret @api_secret end |
#host ⇒ Object
Returns the value of attribute host.
10 11 12 |
# File 'lib/little/configuration.rb', line 10 def host @host end |
#http_open_timeout ⇒ Object
Returns the value of attribute http_open_timeout.
11 12 13 |
# File 'lib/little/configuration.rb', line 11 def http_open_timeout @http_open_timeout end |
#http_read_timeout ⇒ Object
Returns the value of attribute http_read_timeout.
11 12 13 |
# File 'lib/little/configuration.rb', line 11 def http_read_timeout @http_read_timeout end |
#proxy_host ⇒ Object
Returns the value of attribute proxy_host.
12 13 14 |
# File 'lib/little/configuration.rb', line 12 def proxy_host @proxy_host end |
#proxy_pass ⇒ Object
Returns the value of attribute proxy_pass.
12 13 14 |
# File 'lib/little/configuration.rb', line 12 def proxy_pass @proxy_pass end |
#proxy_port ⇒ Object
Returns the value of attribute proxy_port.
12 13 14 |
# File 'lib/little/configuration.rb', line 12 def proxy_port @proxy_port end |
#proxy_user ⇒ Object
Returns the value of attribute proxy_user.
12 13 14 |
# File 'lib/little/configuration.rb', line 12 def proxy_user @proxy_user end |
#secure ⇒ Object
Returns the value of attribute secure.
10 11 12 |
# File 'lib/little/configuration.rb', line 10 def secure @secure end |
Instance Method Details
#port ⇒ Object
17 18 19 |
# File 'lib/little/configuration.rb', line 17 def port defined?(@port) ? @port : (secure ? 443 : 80) end |
#port=(value) ⇒ Object
14 15 16 |
# File 'lib/little/configuration.rb', line 14 def port=(value) @port = value end |