Class YAML::Transformer::Match
In: lib/yaml_extensions/transform.rb
Parent: Object

Methods

[]   call   dottify   new   to_s   unique_name  

Public Class methods

[Source]

# File lib/yaml_extensions/transform.rb, line 178
      def initialize ( name=nil, &block )
        @block = block
        @name = name
        @uid = @@cpt
        @@cpt += 1
      end

Public Instance methods

[]( key, value )

Alias for call

[Source]

# File lib/yaml_extensions/transform.rb, line 190
      def call ( key, value )
        @block[key, value]
      end

[Source]

# File lib/yaml_extensions/transform.rb, line 186
      def dottify ( stream )
        stream << "match#{@uid} [shape=circle, color=green, label=#{self}]\n"
      end

[Source]

# File lib/yaml_extensions/transform.rb, line 200
      def to_s
        @name.nil? ? unique_name : "\"#{@name}\""
      end

[Source]

# File lib/yaml_extensions/transform.rb, line 196
      def unique_name
        "match#{@uid}"
      end

[Validate]