Method: ActiveModel::AttributeMethods#respond_to?
- Defined in:
- lib/active_model/attribute_methods.rb
#respond_to?(method, include_private_methods = false) ⇒ Boolean
423 424 425 426 427 428 429 430 431 432 433 |
# File 'lib/active_model/attribute_methods.rb', line 423 def respond_to?(method, include_private_methods = false) if super true elsif !include_private_methods && super(method, true) # If we're here then we haven't found among non-private methods # but found among all methods. Which means that the given method is private. false else !match_attribute_method?(method.to_s).nil? end end |