Method: ActiveSupport::TimeWithZone#respond_to?

Defined in:
lib/active_support/time_with_zone.rb

#respond_to?(sym, include_priv = false) ⇒ Boolean

respond_to_missing? is not called in some cases, such as when type conversion is performed with Kernel#String

Returns:

  • (Boolean)


535
536
537
538
539
# File 'lib/active_support/time_with_zone.rb', line 535

def respond_to?(sym, include_priv = false)
  # ensure that we're not going to throw and rescue from NoMethodError in method_missing which is slow
  return false if sym.to_sym == :to_str
  super
end