Module: Superstore::Core

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/superstore/core.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/superstore/core.rb', line 5

def inspect
  inspection = ["#{self.class.primary_key}: #{id.inspect}"]

  (self.class.attribute_names - [self.class.primary_key]).each do |name|
    value = send(name)

    if value.present? || value === false
      inspection << "#{name}: #{attribute_for_inspect(name)}"
    end
  end

  "#<#{self.class} #{inspection * ', '}>"
end