Sha256: d86fef5e4cc97819baf1dd5665b112707af5bcbdfecec1235716753bd75ff7e2

Contents?: true

Size: 441 Bytes

Versions: 14

Compression:

Stored size: 441 Bytes

Contents

module Inspectionable
  def inspect
    attr_list = attributes.map do |key, value|
      value_str = if value.is_a? ActiveModel::Model
                    "#<#{value.class}: #{format '%<id>#018x', id: value.object_id << 1}>"
                  else
                    value.inspect
                  end
      "#{key}: #{value_str}"
    end.join ', '
    "#<#{self.class}: #{format '%<id>#018x', id: object_id << 1} #{attr_list}>"
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
barkibu-kb-0.27.0 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.26.0 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.25.0 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.24.1 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.24.0 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.23.0 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.22.0 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.21.0 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.20.0 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.19.0 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.18.0 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.17.0 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.16.2 lib/kb/models/concerns/inspectionable.rb
barkibu-kb-0.16.1 lib/kb/models/concerns/inspectionable.rb