Module: RailsAdmin::Config::Inspectable

Included in:
Fields::Base, Model, Sections::Base
Defined in:
lib/rails_admin/config/inspectable.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject


4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/rails_admin/config/inspectable.rb', line 4

def inspect
  set_named_instance_variables

  instance_name = try(:name) || try(:abstract_model).try(:model).try(:name)
  instance_name = instance_name ? "[#{instance_name}]" : ''

  instance_vars = instance_variables.collect do |v|
    instance_variable_name(v)
  end.join(', ')

  "#<#{self.class.name}#{instance_name} #{instance_vars}>"
end