Module: RTM::Topology::Modifier

Extended by:
Modifier
Included in:
Modifier
Defined in:
lib/rtm/topology.rb

Overview

Manages Modifiers which may be applied to Constructs (or only to Topics?!)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#default#call (readonly)

The default modifier is #nop

Returns:

  • (#call)

    the default modifier



118
119
120
# File 'lib/rtm/topology.rb', line 118

def default
  @default
end

Instance Method Details

#best_name#call

The best_name Modifier returns the best name for a Construct: {|x| x.best_name}

Returns:

  • (#call)

    The best_name Modifier returns a name suitable for human consumption



102
103
104
# File 'lib/rtm/topology.rb', line 102

def best_name
  Proc.new {|x| x.best_name}
end

#nop#call

The nop Modifier just returns the construct given as is: {|x| x}

Returns:

  • (#call)

    The nop Modifier which is a callable object which takes one argument and returns this argument.



95
96
97
# File 'lib/rtm/topology.rb', line 95

def nop
  Proc.new {|x| x}
end

#reference#call

The reference Modifier returns a reference for a Construct: {|x| x.reference}

Returns:

  • (#call)

    The reference Modifier returns a name suitable for human consumption



109
110
111
# File 'lib/rtm/topology.rb', line 109

def reference
  Proc.new {|x| x.reference}
end