Class: Integral::Object

Inherits:
ListItem show all
Defined in:
app/models/integral/object.rb

Overview

List item which is linked to a particular object i.e. A Post

Instance Method Summary collapse

Methods inherited from ListItem

#basic?, #has_children?, #link?, types_collection

Methods inherited from ApplicationRecord

available_statuses

Instance Method Details

#objectObject

Returns the object associated with the list item.

Returns:

  • (Object)

    the object associated with the list item



12
13
14
# File 'app/models/integral/object.rb', line 12

def object
  @object ||= object_klass.find_by_id(object_id)
end

#object=(object) ⇒ Object

Sets the related object



17
18
19
20
# File 'app/models/integral/object.rb', line 17

def object=(object)
  self.object_id = object.id
  self.object_type = object.class
end

#object?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/models/integral/object.rb', line 7

def object?
  true
end