Class: RSpec::Support::ObjectFormatter::TimeInspector Private

Inherits:
BaseInspector show all
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.

"%Y-%m-%d %H:%M:%S"

Instance Attribute Summary

Attributes inherited from BaseInspector

#formatter, #object

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseInspector

#pretty_print

Methods inherited from Struct

#as_json

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.

Returns:

  • (Boolean)


142
143
144
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-support-3.12.0/lib/rspec/support/object_formatter.rb', line 142

def self.can_inspect?(object)
  Time === object
end

Instance Method Details

#inspectObject

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.

for 1.8.7



151
152
153
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-support-3.12.0/lib/rspec/support/object_formatter.rb', line 151

def inspect
  object.strftime("#{FORMAT}.#{"%09d" % object.nsec} %z")
end