lib/ach_builder.rb in ach_builder-0.2.1 vs lib/ach_builder.rb in ach_builder-0.2.2
- old
+ new
@@ -20,9 +20,14 @@
autoload :Component
autoload :Record
autoload :Batch
autoload :File
+ # For a given string, try to locate the corresponding constant
+ # (apparently Class) under the {ACH} or {ACH::Record} modules.
+ #
+ # @param [String] name
+ # @return [Object]
def self.to_const(name)
[self, self::Record].detect{ |mod| mod.const_defined?(name) }.const_get(name)
end
end