Module: OFlow::HasName

Included in:
Env, Flow, Task
Defined in:
lib/oflow/hasname.rb

Overview

Adds support for a name attribute and the ability to form full name for a named item.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject (readonly)

The name.



8
9
10
# File 'lib/oflow/hasname.rb', line 8

def name
  @name
end

Instance Method Details

#full_nameString

Similar to a full file path. The full_name described the containment of the named item.

Returns:

  • (String)

    full name of item



22
23
24
25
26
27
28
# File 'lib/oflow/hasname.rb', line 22

def full_name()
  if @flow.respond_to?(:full_name)
    @flow.full_name() + ':' + @name.to_s
  else
    @name.to_s
  end
end

#init_name(flow, name) ⇒ Object

The containing Flow is used to support the full_name() method otherwise it just sets the name.

Parameters:

  • flow (Flow|Env)

    containing Flow

  • name (Symbol|String)

    base name



14
15
16
17
# File 'lib/oflow/hasname.rb', line 14

def init_name(flow, name)
  @flow = flow
  @name = name.to_sym
end