Class: Changebase::Inline::Event
- Inherits:
-
Object
- Object
- Changebase::Inline::Event
- Defined in:
- lib/changebase/inline/event.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#database_id ⇒ Object
Returns the value of attribute database_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#schema ⇒ Object
Returns the value of attribute schema.
-
#table ⇒ Object
Returns the value of attribute table.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(attrs) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(attrs) ⇒ Event
Returns a new instance of Event.
6 7 8 9 10 |
# File 'lib/changebase/inline/event.rb', line 6 def initialize(attrs) attrs.each { |k,v| self.send("#{k}=", v) } self.columns ||= {} end |
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
3 4 5 |
# File 'lib/changebase/inline/event.rb', line 3 def columns @columns end |
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/changebase/inline/event.rb', line 3 def created_at @created_at end |
#database_id ⇒ Object
Returns the value of attribute database_id.
3 4 5 |
# File 'lib/changebase/inline/event.rb', line 3 def database_id @database_id end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/changebase/inline/event.rb', line 3 def id @id end |
#schema ⇒ Object
Returns the value of attribute schema.
3 4 5 |
# File 'lib/changebase/inline/event.rb', line 3 def schema @schema end |
#table ⇒ Object
Returns the value of attribute table.
3 4 5 |
# File 'lib/changebase/inline/event.rb', line 3 def table @table end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/changebase/inline/event.rb', line 3 def @timestamp end |
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
3 4 5 |
# File 'lib/changebase/inline/event.rb', line 3 def transaction_id @transaction_id end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/changebase/inline/event.rb', line 3 def type @type end |
Instance Method Details
#as_json ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/changebase/inline/event.rb', line 12 def as_json { id: id, transaction_id: transaction_id, lsn: .utc.iso8601(3), type: type, schema: schema, table: table, timestamp: .utc.iso8601(3), columns: columns.as_json }.compact end |