class Nucleus::AbstractModel

@author Cedric Roeck (cedric.roeck@gmail.com) @since 0.1.0

Attributes

created_at[RW]
id[RW]
name[RW]
updated_at[RW]

Public Class Methods

new(hash = nil) click to toggle source
# File lib/nucleus/core/models/abstract_model.rb, line 13
def initialize(hash = nil)
  return if hash.nil?
  @name = hash['name']
  @id = hash['id']
end

Public Instance Methods

inspect() click to toggle source
# File lib/nucleus/core/models/abstract_model.rb, line 25
def inspect
  to_s
end
to_s() click to toggle source
Calls superclass method
# File lib/nucleus/core/models/abstract_model.rb, line 19
def to_s
  return name if respond_to?('name')
  return id if id
  super.to_s
end