Class: Huemote::Bridge
- Inherits:
-
Object
- Object
- Huemote::Bridge
- Defined in:
- lib/huemote/bridge.rb
Constant Summary collapse
- DEVICE_TYPE =
"Huemote"- USERNAME =
"HuemoteRubyGem"
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #_get(path, params = {}) ⇒ Object
- #_post(path, params = {}) ⇒ Object
- #_put(path, params = {}) ⇒ Object
-
#initialize(host, port, body) ⇒ Bridge
constructor
A new instance of Bridge.
Constructor Details
#initialize(host, port, body) ⇒ Bridge
Returns a new instance of Bridge.
29 30 31 32 |
# File 'lib/huemote/bridge.rb', line 29 def initialize(host,port,body) @host, @port = host, port @name = body.match(/<friendlyName>([^<]+)<\/friendlyName>/)[1] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
27 28 29 |
# File 'lib/huemote/bridge.rb', line 27 def name @name end |
Class Method Details
.get ⇒ Object
10 11 12 |
# File 'lib/huemote/bridge.rb', line 10 def get @bridge ||= discover end |
Instance Method Details
#_get(path, params = {}) ⇒ Object
34 35 36 |
# File 'lib/huemote/bridge.rb', line 34 def _get(path,params={}) request(:get,path,params) end |
#_post(path, params = {}) ⇒ Object
38 39 40 |
# File 'lib/huemote/bridge.rb', line 38 def _post(path,params={}) request(:post,path,params) end |
#_put(path, params = {}) ⇒ Object
42 43 44 |
# File 'lib/huemote/bridge.rb', line 42 def _put(path,params={}) request(:put,path,params) end |