method
new
v5.1.7 -
Show latest stable
- Class:
ActiveModel::AttributeMethods::ClassMethods::AttributeMethodMatcher
new(options = {})public
No documentation available.
# File activemodel/lib/active_model/attribute_methods.rb, line 394
def initialize(options = {})
@prefix, @suffix = options.fetch(:prefix, ""), options.fetch(:suffix, "")
@regex = /^(?:#{Regexp.escape(@prefix)})(.*)(?:#{Regexp.escape(@suffix)})$/
@method_missing_target = "#{@prefix}attribute#{@suffix}"
@method_name = "#{prefix}%s#{suffix}"
end