Class: RubyObjectTemplate

Inherits:
ObjectTemplate show all
Defined in:
lib/object-template.rb

Overview

Template specified by array or hash of ruby objects. The #== and #=== methods of entry values are used in matching. Entry values may include classes, regexes, ranges, and so on, in addition to single values.

Constant Summary

Constants inherited from ObjectTemplate

ObjectTemplate::VERSION

Instance Attribute Summary

Attributes inherited from ObjectTemplate

#key_converter, #spec

Instance Method Summary collapse

Methods inherited from ObjectTemplate

#===, #initialize, #inspect, #optimize!

Constructor Details

This class inherits a constructor from ObjectTemplate

Instance Method Details

#fill_matchers(k, v) ⇒ Object

:nodoc:



96
97
98
99
100
101
# File 'lib/object-template.rb', line 96

def fill_matchers k, v  # :nodoc:
  if key_converter
    (v = key_converter[v]) rescue nil # error means templating object
  end
  @matchers << [k, v]
end