Module: Her::Model::Introspection

Extended by:
ActiveSupport::Concern
Included in:
Her::Model
Defined in:
lib/her/model/introspection.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#inspectObject

Inspect an element, returns it for introspection.

Examples:

class User
  include Her::Model
end

@user = User.find(1)
p @user # => #<User(/users/1) id=1 name="Tobias Fünke">


14
15
16
# File 'lib/her/model/introspection.rb', line 14

def inspect
  "#<#{self.class} #{@data.keys.map { |k| "#{k}: #{attribute_for_inspect(send(k))}" }.join(", ")}>"
end