Class: Holoserve::Connector

Inherits:
Object
  • Object
show all
Defined in:
lib/holoserve/connector.rb

Defined Under Namespace

Classes: Error

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = { })
  @host, @port = *options.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

#bucketObject (readonly)

Returns the value of attribute bucket.



16
17
18
# File 'lib/holoserve/connector.rb', line 16

def bucket
  @bucket
end

#historyObject (readonly)

Returns the value of attribute history.



17
18
19
# File 'lib/holoserve/connector.rb', line 17

def history
  @history
end

#hostObject (readonly)

Returns the value of attribute host.



13
14
15
# File 'lib/holoserve/connector.rb', line 13

def host
  @host
end

#pairsObject (readonly)

Returns the value of attribute pairs.



18
19
20
# File 'lib/holoserve/connector.rb', line 18

def pairs
  @pairs
end

#portObject (readonly)

Returns the value of attribute port.



14
15
16
# File 'lib/holoserve/connector.rb', line 14

def port
  @port
end

#stateObject (readonly)

Returns the value of attribute state.



19
20
21
# File 'lib/holoserve/connector.rb', line 19

def state
  @state
end

Instance Method Details

#inspectObject



36
37
38
# File 'lib/holoserve/connector.rb', line 36

def inspect
  "<#{self.class} at #{@host}:#{@port}>"
end

#urlObject



32
33
34
# File 'lib/holoserve/connector.rb', line 32

def url
  "http://#{@host}:#{@port}/_control"
end