Class: Contracts::Formatters::ObjectInspectWrapper

Inherits:
Object
  • Object
show all
Includes:
InspectWrapper
Defined in:
lib/contracts/formatters.rb

Instance Method Summary collapse

Methods included from InspectWrapper

create, #delim, #initialize, #inspect, inspector_klass, #to_s

Instance Method Details

#custom_to_s?Boolean

Returns:

  • (Boolean)


124
125
126
# File 'lib/contracts/formatters.rb', line 124

def custom_to_s?
  !@value.to_s.match(/#\<\w+:.+\>/)
end

#useful_inspectObject



128
129
130
# File 'lib/contracts/formatters.rb', line 128

def useful_inspect
  strip_prefix(empty_to_s? ? @value.class.name : @value.inspect)
end