Module: Inspectionable

Included in:
KB::BaseModel, KB::Condition, KB::Symptom
Defined in:
lib/kb/models/concerns/inspectionable.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/kb/models/concerns/inspectionable.rb', line 2

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