Class: TableSync::Publishing::Data::Raw
- Inherits:
-
Object
- Object
- TableSync::Publishing::Data::Raw
- Defined in:
- lib/table_sync/publishing/data/raw.rb
Instance Attribute Summary collapse
-
#attributes_for_sync ⇒ Object
readonly
Returns the value of attribute attributes_for_sync.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#object_class ⇒ Object
readonly
Returns the value of attribute object_class.
Instance Method Summary collapse
- #construct ⇒ Object
-
#initialize(object_class:, attributes_for_sync:, event:) ⇒ Raw
constructor
A new instance of Raw.
- #version ⇒ Object
Constructor Details
#initialize(object_class:, attributes_for_sync:, event:) ⇒ Raw
Returns a new instance of Raw.
7 8 9 10 11 |
# File 'lib/table_sync/publishing/data/raw.rb', line 7 def initialize(object_class:, attributes_for_sync:, event:) @object_class = object_class @attributes_for_sync = attributes_for_sync @event = TableSync::Event.new(event) end |
Instance Attribute Details
#attributes_for_sync ⇒ Object (readonly)
Returns the value of attribute attributes_for_sync.
5 6 7 |
# File 'lib/table_sync/publishing/data/raw.rb', line 5 def attributes_for_sync @attributes_for_sync end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
5 6 7 |
# File 'lib/table_sync/publishing/data/raw.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/data/raw.rb', line 5 def object_class @object_class end |
Instance Method Details
#construct ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/table_sync/publishing/data/raw.rb', line 13 def construct { model: object_class, attributes: attributes_for_sync, version: version, event: event.resolve, metadata: event., } end |
#version ⇒ Object
23 24 25 |
# File 'lib/table_sync/publishing/data/raw.rb', line 23 def version Time.current.to_f end |