Class: Switcher::Facade
- Inherits:
-
Object
- Object
- Switcher::Facade
- Defined in:
- lib/switcher/facade.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#bubble_cancelled ⇒ Object
readonly
Returns the value of attribute bubble_cancelled.
-
#stopped ⇒ Object
readonly
Returns the value of attribute stopped.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#target_state ⇒ Object
readonly
Returns the value of attribute target_state.
Instance Method Summary collapse
- #cancel_bubble ⇒ Object
-
#initialize(target, data) ⇒ Facade
constructor
A new instance of Facade.
- #stop ⇒ Object (also: #restrict)
- #switch_to(state) ⇒ Object
Constructor Details
#initialize(target, data) ⇒ Facade
Returns a new instance of Facade.
3 4 5 6 7 8 9 10 |
# File 'lib/switcher/facade.rb', line 3 def initialize(target, data) @args = data @stopped = false @target = target @bubble_cancelled = false @target_state = nil end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
12 13 14 |
# File 'lib/switcher/facade.rb', line 12 def args @args end |
#bubble_cancelled ⇒ Object (readonly)
Returns the value of attribute bubble_cancelled.
12 13 14 |
# File 'lib/switcher/facade.rb', line 12 def bubble_cancelled @bubble_cancelled end |
#stopped ⇒ Object (readonly)
Returns the value of attribute stopped.
12 13 14 |
# File 'lib/switcher/facade.rb', line 12 def stopped @stopped end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
12 13 14 |
# File 'lib/switcher/facade.rb', line 12 def target @target end |
#target_state ⇒ Object (readonly)
Returns the value of attribute target_state.
12 13 14 |
# File 'lib/switcher/facade.rb', line 12 def target_state @target_state end |
Instance Method Details
#cancel_bubble ⇒ Object
25 26 27 |
# File 'lib/switcher/facade.rb', line 25 def cancel_bubble @bubble_cancelled = true end |
#stop ⇒ Object Also known as: restrict
14 15 16 17 |
# File 'lib/switcher/facade.rb', line 14 def stop @stopped = true @bubble_cancelled = true end |
#switch_to(state) ⇒ Object
21 22 23 |
# File 'lib/switcher/facade.rb', line 21 def switch_to(state) @target_state = state.to_sym end |