Class: Winker::Scene
- Inherits:
-
Object
- Object
- Winker::Scene
- Defined in:
- lib/winker/scene.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#obj_data ⇒ Object
Returns the value of attribute obj_data.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #activate ⇒ Object
-
#initialize(obj_data) ⇒ Scene
constructor
A new instance of Scene.
- #members ⇒ Object
- #method_missing(method_sym, *arguments, &block) ⇒ Object
- #settings ⇒ Object
Constructor Details
#initialize(obj_data) ⇒ Scene
Returns a new instance of Scene.
11 12 13 14 |
# File 'lib/winker/scene.rb', line 11 def initialize(obj_data) @obj_data = obj_data @id = @obj_data.scene_id end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_sym, *arguments, &block) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/winker/scene.rb', line 28 def method_missing(method_sym, *arguments, &block) if obj_data.respond_to?(method_sym) obj_data.send(method_sym, *arguments, &block) else super end end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/winker/scene.rb', line 5 def id @id end |
#obj_data ⇒ Object
Returns the value of attribute obj_data.
5 6 7 |
# File 'lib/winker/scene.rb', line 5 def obj_data @obj_data end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/winker/scene.rb', line 5 def type @type end |
Class Method Details
Instance Method Details
#activate ⇒ Object
24 25 26 |
# File 'lib/winker/scene.rb', line 24 def activate Winker.activate_scene(self.id) end |
#members ⇒ Object
16 17 18 |
# File 'lib/winker/scene.rb', line 16 def members devices.select{|d| @obj_data.members.map{|m| m[:object_id]}.include?(d.id)} end |
#settings ⇒ Object
20 21 22 |
# File 'lib/winker/scene.rb', line 20 def settings @obj_data.members end |