Class: TableSync::Publishing::Helpers::Objects
- Inherits:
-
Object
- Object
- TableSync::Publishing::Helpers::Objects
- Defined in:
- lib/table_sync/publishing/helpers/objects.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#object_class ⇒ Object
readonly
Returns the value of attribute object_class.
-
#original_attributes ⇒ Object
readonly
Returns the value of attribute original_attributes.
Instance Method Summary collapse
- #construct_list ⇒ Object
-
#initialize(object_class:, original_attributes:, event:) ⇒ Objects
constructor
A new instance of Objects.
Constructor Details
#initialize(object_class:, original_attributes:, event:) ⇒ Objects
Returns a new instance of Objects.
7 8 9 10 11 |
# File 'lib/table_sync/publishing/helpers/objects.rb', line 7 def initialize(object_class:, original_attributes:, event:) @event = TableSync::Event.new(event) @object_class = object_class.constantize @original_attributes = Array.wrap(original_attributes) end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
5 6 7 |
# File 'lib/table_sync/publishing/helpers/objects.rb', line 5 def event @event end |
#object_class ⇒ Object (readonly)
Returns the value of attribute object_class.
5 6 7 |
# File 'lib/table_sync/publishing/helpers/objects.rb', line 5 def object_class @object_class end |
#original_attributes ⇒ Object (readonly)
Returns the value of attribute original_attributes.
5 6 7 |
# File 'lib/table_sync/publishing/helpers/objects.rb', line 5 def original_attributes @original_attributes end |
Instance Method Details
#construct_list ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/table_sync/publishing/helpers/objects.rb', line 13 def construct_list if event.destroy? init_objects else without_empty_objects(find_objects) end end |