Class: Vizcore::DSL::Engine::KeyBindingBuilder Private

Inherits:
Object
  • Object
show all
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

Constructor Details

#initializeKeyBindingBuilder

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

#blackoutvoid

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

#freezevoid

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.

Parameters:

  • control (Symbol, String)

Raises:

  • (ArgumentError)


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.

Parameters:

  • name (Symbol, String)

Raises:

  • (ArgumentError)


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_hHash

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.

Returns:

  • (Hash)

    serialized key action



487
488
489
# File 'lib/vizcore/dsl/engine.rb', line 487

def to_h
  @action || {}
end