Class: Switchbot::Scene

Inherits:
Object
  • Object
show all
Defined in:
lib/switchbot/scene.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:, scene_id:) ⇒ Scene

Returns a new instance of Scene.



7
8
9
10
# File 'lib/switchbot/scene.rb', line 7

def initialize(client:, scene_id:)
  @client = client
  @scene_id = scene_id
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/switchbot/scene.rb', line 5

def client
  @client
end

#scene_idObject (readonly)

Returns the value of attribute scene_id.



5
6
7
# File 'lib/switchbot/scene.rb', line 5

def scene_id
  @scene_id
end

Instance Method Details

#executeObject



12
13
14
# File 'lib/switchbot/scene.rb', line 12

def execute
  client.execute(scene_id: scene_id)
end