Class: RSpec::Support::ObjectFormatter::DateTimeInspector Private
- Inherits:
-
BaseInspector
- Object
- Struct
- BaseInspector
- RSpec::Support::ObjectFormatter::DateTimeInspector
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-support-3.12.0/lib/rspec/support/object_formatter.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- FORMAT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"%a, %d %b %Y %H:%M:%S.%N %z"
Instance Attribute Summary
Attributes inherited from BaseInspector
Class Method Summary collapse
- .can_inspect?(object) ⇒ Boolean private
Instance Method Summary collapse
-
#inspect ⇒ Object
private
ActiveSupport sometimes overrides inspect.
Methods inherited from BaseInspector
Methods inherited from Struct
Class Method Details
.can_inspect?(object) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
160 161 162 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-support-3.12.0/lib/rspec/support/object_formatter.rb', line 160 def self.can_inspect?(object) defined?(DateTime) && DateTime === object end |
Instance Method Details
#inspect ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
ActiveSupport sometimes overrides inspect. If ‘ActiveSupport` is defined use a custom format string that includes more time precision.
166 167 168 169 170 171 172 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-support-3.12.0/lib/rspec/support/object_formatter.rb', line 166 def inspect if defined?(ActiveSupport) object.strftime(FORMAT) else object.inspect end end |