class method
self.new
Ruby on Rails 3.1.12
Since v3.0.20 Last seen in v3.2.22.5Signature
self.new(options = {})
No documentation comment.
Parameters
-
optionsopt = {}
Source
# File activemodel/lib/active_model/attribute_methods.rb, line 346
def initialize(options = {})
options.symbolize_keys!
@prefix, @suffix = options[:prefix] || '', options[:suffix] || ''
@regex = /\A(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})\z/
@method_missing_target = "#{@prefix}attribute#{@suffix}"
@method_name = "#{prefix}%s#{suffix}"
end
Defined in activemodel/lib/active_model/attribute_methods.rb line 346
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::AttributeMethods::ClassMethods::AttributeMethodMatcher