Sha256: d73a229dc8fc5909012d1b1591394d3f6cc89af4b1c0c3f4610c6c498dc7a66f
Contents?: true
Size: 616 Bytes
Versions: 15
Compression:
Stored size: 616 Bytes
Contents
module CassandraObject module Inspect def inspect inspection = ["#{self.class.primary_key}: #{id.inspect}"] @model_attributes.each do |attribute, value| if value.present? inspection << "#{attribute}: #{attribute_for_inspect(value)}" end end "#<#{self.class} #{inspection * ', '}>" end def attribute_for_inspect(value) if value.is_a?(String) && value.length > 50 "#{value[0..50]}...".inspect elsif value.is_a?(Date) || value.is_a?(Time) %("#{value.to_s(:db)}") else value.inspect end end end end
Version data entries
15 entries across 15 versions & 1 rubygems