Class: Flow::Step
- Inherits:
-
Object
- Object
- Flow::Step
- Defined in:
- lib/flow-lite.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#names ⇒ Object
readonly
e.g.
Instance Method Summary collapse
-
#initialize(name_or_names, block) ⇒ Step
constructor
A new instance of Step.
-
#name ⇒ Object
“primary” name.
Constructor Details
#initialize(name_or_names, block) ⇒ Step
Returns a new instance of Step.
36 37 38 39 40 41 42 43 44 |
# File 'lib/flow-lite.rb', line 36 def initialize( name_or_names, block ) @names = if name_or_names.is_a?( Array ) name_or_names else [name_or_names] ## assume single symbol (name); wrap in array end @names = @names.map {|name| name.to_sym } ## make sure we always use symbols @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
32 33 34 |
# File 'lib/flow-lite.rb', line 32 def block @block end |
#names ⇒ Object (readonly)
e.g. :list or [:list,:ls] etc.
31 32 33 |
# File 'lib/flow-lite.rb', line 31 def names @names end |
Instance Method Details
#name ⇒ Object
“primary” name
34 |
# File 'lib/flow-lite.rb', line 34 def name() @names[0]; end |