Module: OpConnect::Configurable
- Included in:
- Client
- Defined in:
- lib/op_connect/configurable.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#adapter ⇒ Object
Returns the value of attribute adapter.
- #api_endpoint ⇒ Object
-
#stubs ⇒ Object
Returns the value of attribute stubs.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
3 4 5 |
# File 'lib/op_connect/configurable.rb', line 3 def access_token @access_token end |
#adapter ⇒ Object
Returns the value of attribute adapter.
3 4 5 |
# File 'lib/op_connect/configurable.rb', line 3 def adapter @adapter end |
#api_endpoint ⇒ Object
35 36 37 |
# File 'lib/op_connect/configurable.rb', line 35 def api_endpoint ::File.join(@api_endpoint, "") end |
#stubs ⇒ Object
Returns the value of attribute stubs.
3 4 5 |
# File 'lib/op_connect/configurable.rb', line 3 def stubs @stubs end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
3 4 5 |
# File 'lib/op_connect/configurable.rb', line 3 def user_agent @user_agent end |
Class Method Details
.keys ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/op_connect/configurable.rb', line 7 def keys @keys ||= [ :access_token, :adapter, :api_endpoint, :stubs, :user_agent ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
18 19 20 |
# File 'lib/op_connect/configurable.rb', line 18 def configure yield self end |
#reset! ⇒ Object Also known as: setup
22 23 24 25 26 27 28 |
# File 'lib/op_connect/configurable.rb', line 22 def reset! OpConnect::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", OpConnect::Default.[key]) end self end |
#same_options?(opts) ⇒ Boolean
31 32 33 |
# File 'lib/op_connect/configurable.rb', line 31 def (opts) opts.hash == .hash end |