Class: Micdrop::Ext::Sequel::InsertSink
- Inherits:
-
Object
- Object
- Micdrop::Ext::Sequel::InsertSink
- Defined in:
- lib/micdrop/ext/sequel.rb
Overview
A sink which will exclusively insert new items into the database
Instance Attribute Summary collapse
-
#insert_id ⇒ Object
readonly
Returns the value of attribute insert_id.
Instance Method Summary collapse
- #<<(collector) ⇒ Object
-
#initialize(dataset) ⇒ InsertSink
constructor
A new instance of InsertSink.
Constructor Details
#initialize(dataset) ⇒ InsertSink
Returns a new instance of InsertSink.
11 12 13 |
# File 'lib/micdrop/ext/sequel.rb', line 11 def initialize(dataset) @dataset = dataset end |
Instance Attribute Details
#insert_id ⇒ Object (readonly)
Returns the value of attribute insert_id.
15 16 17 |
# File 'lib/micdrop/ext/sequel.rb', line 15 def insert_id @insert_id end |
Instance Method Details
#<<(collector) ⇒ Object
17 18 19 |
# File 'lib/micdrop/ext/sequel.rb', line 17 def <<(collector) @insert_id = @dataset.insert(**collector) end |