attribute_method?(attribute) public

Returns true if attribute is an attribute method, false otherwise.

class Person 
 include ActiveModel ::Validations
 attr_accessor :name
end
User .attribute_method? (:name) # => true
User .attribute_method? (:age) # => false
Show source
# File activemodel/lib/active_model/validations.rb, line 247
 def attribute_method?(attribute)
 method_defined?(attribute)
 end
Register or log in to add new notes.

AltStyle によって変換されたページ (->オリジナル) /