Sha256: dc48a8615e8c2dd1cc6c58967bef873c44584eef4e47e26e5451a83daa684ff1
Contents?: true
Size: 610 Bytes
Versions: 38
Compression:
Stored size: 610 Bytes
Contents
module CassandraObject module Inspect def inspect inspection = ["#{self.class.primary_key}: #{id.inspect}"] @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
38 entries across 38 versions & 3 rubygems