Class: Neo::Rails::Scenarios::Scenario
- Inherits:
-
Object
- Object
- Neo::Rails::Scenarios::Scenario
- Defined in:
- lib/neo/rails/scenarios.rb
Overview
A simple class encapsulating a scenario:
-
the corresponding action
-
the scenario’s name
-
an humanized name as label
-
the blocked which will be called when applying a scenario
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(action, name, block, options) ⇒ Scenario
constructor
A new instance of Scenario.
- #label ⇒ Object
Constructor Details
#initialize(action, name, block, options) ⇒ Scenario
Returns a new instance of Scenario.
100 101 102 103 104 105 |
# File 'lib/neo/rails/scenarios.rb', line 100 def initialize(action, name, block, ) @action = action.to_sym @name = name.to_sym @block = block @options = end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
98 99 100 |
# File 'lib/neo/rails/scenarios.rb', line 98 def action @action end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
98 99 100 |
# File 'lib/neo/rails/scenarios.rb', line 98 def block @block end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
98 99 100 |
# File 'lib/neo/rails/scenarios.rb', line 98 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
98 99 100 |
# File 'lib/neo/rails/scenarios.rb', line 98 def @options end |
Instance Method Details
#label ⇒ Object
107 108 109 |
# File 'lib/neo/rails/scenarios.rb', line 107 def label "#{@action.to_s.humanize} -> #{@name.to_s.humanize}" end |