Class: Flow::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/flow-lite.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#blockObject (readonly)

Returns the value of attribute block.



32
33
34
# File 'lib/flow-lite.rb', line 32

def block
  @block
end

#namesObject (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

#nameObject

“primary” name



34
# File 'lib/flow-lite.rb', line 34

def name() @names[0]; end