Object
# File lib/active_model/attribute_methods.rb, line 355 355: def initialize(options = {}) 356: options.symbolize_keys! 357: 358: if options[:prefix] == '' || options[:suffix] == '' 359: ActiveSupport::Deprecation.warn( 360: "Specifying an empty prefix/suffix for an attribute method is no longer " "necessary. If the un-prefixed/suffixed version of the method has not been " "defined when `define_attribute_methods` is called, it will be defined " "automatically." 361: ) 362: end 363: 364: @prefix, @suffix = options[:prefix] || '', options[:suffix] || '' 365: @regex = /\A(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})\z/ 366: @method_missing_target = "#{@prefix}attribute#{@suffix}" 367: @method_name = "#{prefix}%s#{suffix}" 368: end
# File lib/active_model/attribute_methods.rb, line 373 373: def match(method_name) 374: if @regex =~ method_name 375: AttributeMethodMatch.new(method_missing_target, $2, method_name) 376: else 377: nil 378: end 379: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.