Class: Switcher::Spec
- Inherits:
-
Object
- Object
- Switcher::Spec
- Defined in:
- lib/switcher/spec.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#states ⇒ Object
readonly
Returns the value of attribute states.
-
#states_list ⇒ Object
readonly
Returns the value of attribute states_list.
-
#subscribers ⇒ Object
readonly
Returns the value of attribute subscribers.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ Spec
constructor
A new instance of Spec.
- #notify(*list) ⇒ Object
- #state(name, &block) ⇒ Object
Constructor Details
#initialize(name, options = {}) ⇒ Spec
Returns a new instance of Spec.
6 7 8 9 10 11 |
# File 'lib/switcher/spec.rb', line 6 def initialize(name, ={}) @name = name.to_sym @states = {} @states_list = [] @subscribers = [] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/switcher/spec.rb', line 13 def name @name end |
#states ⇒ Object (readonly)
Returns the value of attribute states.
13 14 15 |
# File 'lib/switcher/spec.rb', line 13 def states @states end |
#states_list ⇒ Object (readonly)
Returns the value of attribute states_list.
13 14 15 |
# File 'lib/switcher/spec.rb', line 13 def states_list @states_list end |
#subscribers ⇒ Object (readonly)
Returns the value of attribute subscribers.
13 14 15 |
# File 'lib/switcher/spec.rb', line 13 def subscribers @subscribers end |
Instance Method Details
#notify(*list) ⇒ Object
23 24 25 |
# File 'lib/switcher/spec.rb', line 23 def notify(*list) @subscribers = list end |