Class: TableSync::Publishing::Data::Objects

Inherits:
Object
  • Object
show all
Defined in:
lib/table_sync/publishing/data/objects.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(objects:, event:, custom_version:) ⇒ Objects

Returns a new instance of Objects.



7
8
9
10
11
# File 'lib/table_sync/publishing/data/objects.rb', line 7

def initialize(objects:, event:, custom_version:)
  @objects        = objects
  @event          = TableSync::Event.new(event)
  @custom_version = custom_version
end

Instance Attribute Details

#custom_versionObject (readonly)

Returns the value of attribute custom_version.



5
6
7
# File 'lib/table_sync/publishing/data/objects.rb', line 5

def custom_version
  @custom_version
end

#eventObject (readonly)

Returns the value of attribute event.



5
6
7
# File 'lib/table_sync/publishing/data/objects.rb', line 5

def event
  @event
end

#objectsObject (readonly)

Returns the value of attribute objects.



5
6
7
# File 'lib/table_sync/publishing/data/objects.rb', line 5

def objects
  @objects
end

Instance Method Details

#constructObject



13
14
15
16
17
18
19
20
21
# File 'lib/table_sync/publishing/data/objects.rb', line 13

def construct
  {
    model:,
    attributes: attributes_for_sync,
    version: custom_version || version,
    event: event.resolve,
    metadata: event.,
  }
end