Class: Huemote::Bridge

Inherits:
Object
  • Object
show all
Defined in:
lib/huemote/bridge.rb

Constant Summary collapse

DEVICE_TYPE =
"Huemote"
GOOGLE_IP =
"64.233.187.99"
USERNAME =
"HuemoteRubyGem"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port, body) ⇒ Bridge

Returns a new instance of Bridge.



31
32
33
34
# File 'lib/huemote/bridge.rb', line 31

def initialize(host,port,body)
  @host, @port = host, port
  @name = body.match(/<friendlyName>([^<]+)<\/friendlyName>/)[1]
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



29
30
31
# File 'lib/huemote/bridge.rb', line 29

def name
  @name
end

Class Method Details

.getObject



11
12
13
# File 'lib/huemote/bridge.rb', line 11

def get
  @bridge ||= discover
end

Instance Method Details

#_get(path, params = {}) ⇒ Object



36
37
38
# File 'lib/huemote/bridge.rb', line 36

def _get(path,params={})
  request(:get,path,params)
end

#_post(path, params = {}) ⇒ Object



40
41
42
# File 'lib/huemote/bridge.rb', line 40

def _post(path,params={})
  request(:post,path,params)
end

#_put(path, params = {}) ⇒ Object



44
45
46
# File 'lib/huemote/bridge.rb', line 44

def _put(path,params={})
  request(:put,path,params)
end