Parent

Class/Module Index [+]

Quicksearch

ActiveModel::AttributeMethods::ClassMethods::AttributeMethodMatcher

Attributes

method_missing_target[R]
prefix[R]
suffix[R]

Public Instance Methods

match(method_name) click to toggle source
# File lib/active_model/attribute_methods.rb, line 354
def match(method_name)
  if @regex =~ method_name
    AttributeMethodMatch.new(method_missing_target, $2)
  else
    nil
  end
end
method_name(attr_name) click to toggle source
# File lib/active_model/attribute_methods.rb, line 362
def method_name(attr_name)
  @method_name % attr_name
end

Public Class Methods

new(options = {}) click to toggle source
# File lib/active_model/attribute_methods.rb, line 346
def initialize(options = {})
  options.symbolize_keys!
  @prefix, @suffix = options[:prefix] || '', options[:suffix] || ''
  @regex = /^(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})$/
  @method_missing_target = "#{@prefix}attribute#{@suffix}"
  @method_name = "#{prefix}%s#{suffix}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.