Class: Holoserve::Connector
- Inherits:
-
Object
- Object
- Holoserve::Connector
- Defined in:
- lib/holoserve/connector.rb
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#bucket ⇒ Object
readonly
Returns the value of attribute bucket.
-
#history ⇒ Object
readonly
Returns the value of attribute history.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#pairs ⇒ Object
readonly
Returns the value of attribute pairs.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(options = { }) ⇒ Connector
constructor
A new instance of Connector.
- #inspect ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(options = { }) ⇒ Connector
Returns a new instance of Connector.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/holoserve/connector.rb', line 21 def initialize( = { }) @host, @port = *.values_at(:host, :port) @host ||= "localhost" @port ||= 4250 @bucket = Bucket.new self @history = History.new self @pairs = Pairs.new self @state = State.new self end |
Instance Attribute Details
#bucket ⇒ Object (readonly)
Returns the value of attribute bucket.
16 17 18 |
# File 'lib/holoserve/connector.rb', line 16 def bucket @bucket end |
#history ⇒ Object (readonly)
Returns the value of attribute history.
17 18 19 |
# File 'lib/holoserve/connector.rb', line 17 def history @history end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
13 14 15 |
# File 'lib/holoserve/connector.rb', line 13 def host @host end |
#pairs ⇒ Object (readonly)
Returns the value of attribute pairs.
18 19 20 |
# File 'lib/holoserve/connector.rb', line 18 def pairs @pairs end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
14 15 16 |
# File 'lib/holoserve/connector.rb', line 14 def port @port end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
19 20 21 |
# File 'lib/holoserve/connector.rb', line 19 def state @state end |
Instance Method Details
#inspect ⇒ Object
36 37 38 |
# File 'lib/holoserve/connector.rb', line 36 def inspect "<#{self.class} at #{@host}:#{@port}>" end |
#url ⇒ Object
32 33 34 |
# File 'lib/holoserve/connector.rb', line 32 def url "http://#{@host}:#{@port}/_control" end |