Class: SimpleStack::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_stack/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  self.url = options[:url].to_s.sub(/\/$/, "")
  self.graceful_degradation = options[:graceful_degradation]
  self.cache_enabled = options[:cache_enabled]
  self.timeout = options[:timeout] || 60
  self.read_timeout = options[:read_timeout] || timeout
end

Instance Attribute Details

#cache_enabledObject

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_degradationObject

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_timeoutObject

Returns the value of attribute read_timeout.



3
4
5
# File 'lib/simple_stack/connection.rb', line 3

def read_timeout
  @read_timeout
end

#timeoutObject

Returns the value of attribute timeout.



3
4
5
# File 'lib/simple_stack/connection.rb', line 3

def timeout
  @timeout
end

#urlObject

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, options)
  SimpleStack::Hypervisor.new self, type, options
end

#tokenObject



17
18
19
# File 'lib/simple_stack/connection.rb', line 17

def token
  "TODO"
end