Class: Vizcore::DSL::Engine::KeyBindingBuilder Private
- Inherits:
-
Object
- Object
- Vizcore::DSL::Engine::KeyBindingBuilder
- Defined in:
- lib/vizcore/dsl/engine.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Builder object for ‘key` block internals.
Instance Method Summary collapse
-
#blackout ⇒ void
private
Toggle browser blackout output.
-
#freeze ⇒ void
private
Toggle browser freeze output.
-
#initialize ⇒ KeyBindingBuilder
constructor
private
A new instance of KeyBindingBuilder.
-
#live_control(control) ⇒ void
private
Toggle a browser live control.
-
#switch_scene(name) ⇒ void
private
Switch to a named scene when the key is pressed.
-
#to_h ⇒ Hash
private
Serialized key action.
Constructor Details
#initialize ⇒ KeyBindingBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of KeyBindingBuilder.
446 447 448 |
# File 'lib/vizcore/dsl/engine.rb', line 446 def initialize @action = nil end |
Instance Method Details
#blackout ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Toggle browser blackout output.
464 465 466 |
# File 'lib/vizcore/dsl/engine.rb', line 464 def blackout live_control(:blackout) end |
#freeze ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Toggle browser freeze output.
471 472 473 |
# File 'lib/vizcore/dsl/engine.rb', line 471 def freeze live_control(:freeze) end |
#live_control(control) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Toggle a browser live control.
479 480 481 482 483 484 |
# File 'lib/vizcore/dsl/engine.rb', line 479 def live_control(control) normalized = control.to_s.strip.downcase.to_sym raise ArgumentError, "unsupported live control: #{control}" unless %i[blackout freeze].include?(normalized) assign_action(type: :live_control, control: normalized) end |
#switch_scene(name) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Switch to a named scene when the key is pressed.
454 455 456 457 458 459 |
# File 'lib/vizcore/dsl/engine.rb', line 454 def switch_scene(name) scene_name = name.to_s.strip raise ArgumentError, "switch_scene scene must not be empty" if scene_name.empty? assign_action(type: :switch_scene, scene: scene_name) end |
#to_h ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns serialized key action.
487 488 489 |
# File 'lib/vizcore/dsl/engine.rb', line 487 def to_h @action || {} end |