Class: Nucleus::AbstractModel
- Inherits:
-
Object
- Object
- Nucleus::AbstractModel
show all
- Includes:
- Kwalify::Util::HashLike
- Defined in:
- lib/nucleus/core/models/abstract_model.rb
Overview
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of AbstractModel.
13
14
15
16
17
|
# 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
|
Instance Attribute Details
#created_at ⇒ Object
10
11
12
|
# File 'lib/nucleus/core/models/abstract_model.rb', line 10
def created_at
@created_at
end
|
#id ⇒ Object
8
9
10
|
# File 'lib/nucleus/core/models/abstract_model.rb', line 8
def id
@id
end
|
#name ⇒ Object
9
10
11
|
# File 'lib/nucleus/core/models/abstract_model.rb', line 9
def name
@name
end
|
#updated_at ⇒ Object
11
12
13
|
# File 'lib/nucleus/core/models/abstract_model.rb', line 11
def updated_at
@updated_at
end
|
Instance Method Details
#inspect ⇒ Object
25
26
27
|
# File 'lib/nucleus/core/models/abstract_model.rb', line 25
def inspect
to_s
end
|
#to_s ⇒ Object
19
20
21
22
23
|
# File 'lib/nucleus/core/models/abstract_model.rb', line 19
def to_s
return name if self.respond_to?('name')
return id if id
super.to_s
end
|