class ActiveModel::AttributeMethods::ClassMethods::AttributeMethodMatcher
def initialize(options = {})
def initialize(options = {}) options.symbolize_keys! @prefix, @suffix = options[:prefix] || '', options[:suffix] || '' @regex = /^(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})$/ end
def match(method_name)
def match(method_name) if matchdata = @regex.match(method_name) AttributeMethodMatch.new(method_missing_target, matchdata[2]) else nil end end
def method_missing_target
def method_missing_target :"#{prefix}attribute#{suffix}" end
def method_name(attr_name)
def method_name(attr_name) "#{prefix}#{attr_name}#{suffix}" end