Class: SimpleStack::Connection
- Inherits:
-
Object
- Object
- SimpleStack::Connection
- Defined in:
- lib/simple_stack/connection.rb
Instance Attribute Summary collapse
-
#cache_enabled ⇒ Object
Returns the value of attribute cache_enabled.
-
#graceful_degradation ⇒ Object
Returns the value of attribute graceful_degradation.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #connect_to(type, options) ⇒ Object
-
#initialize(options = {}) ⇒ Connection
constructor
A new instance of Connection.
- #token ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Connection
Returns a new instance of Connection.
5 6 7 8 9 10 11 |
# File 'lib/simple_stack/connection.rb', line 5 def initialize( = {}) self.url = [:url].to_s.sub(/\/$/, "") self.graceful_degradation = [:graceful_degradation] self.cache_enabled = [:cache_enabled] self.timeout = [:timeout] || 60 self.read_timeout = [:read_timeout] || timeout end |
Instance Attribute Details
#cache_enabled ⇒ Object
Returns the value of attribute cache_enabled.
3 4 5 |
# File 'lib/simple_stack/connection.rb', line 3 def cache_enabled @cache_enabled end |
#graceful_degradation ⇒ Object
Returns the value of attribute graceful_degradation.
3 4 5 |
# File 'lib/simple_stack/connection.rb', line 3 def graceful_degradation @graceful_degradation end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
3 4 5 |
# File 'lib/simple_stack/connection.rb', line 3 def read_timeout @read_timeout end |
#timeout ⇒ Object
Returns the value of attribute timeout.
3 4 5 |
# File 'lib/simple_stack/connection.rb', line 3 def timeout @timeout end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/simple_stack/connection.rb', line 3 def url @url end |
Instance Method Details
#connect_to(type, options) ⇒ Object
13 14 15 |
# File 'lib/simple_stack/connection.rb', line 13 def connect_to(type, ) SimpleStack::Hypervisor.new self, type, end |
#token ⇒ Object
17 18 19 |
# File 'lib/simple_stack/connection.rb', line 17 def token "TODO" end |