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.



33
34
35
36
37
38
39
40
41
# File 'lib/flow-lite.rb', line 33

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.



29
30
31
# File 'lib/flow-lite.rb', line 29

def block
  @block
end

#namesObject (readonly)

e.g. :list or [:list,:ls] etc.



28
29
30
# File 'lib/flow-lite.rb', line 28

def names
  @names
end

Instance Method Details

#nameObject

“primary” name



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

def name() @names[0]; end