Class: Pyper::Pipes::Cassandra::Writer
- Inherits:
-
Struct
- Object
- Struct
- Pyper::Pipes::Cassandra::Writer
- Defined in:
- lib/pyper/pipes/cassandra/writer.rb
Overview
Instance Attribute Summary collapse
-
#attribute_filter_set ⇒ Object
Returns the value of attribute attribute_filter_set.
-
#client ⇒ Object
Returns the value of attribute client.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#pipe(attributes, status = {}) ⇒ Hash
The original attributes.
Instance Attribute Details
#attribute_filter_set ⇒ Object
Returns the value of attribute attribute_filter_set
8 9 10 |
# File 'lib/pyper/pipes/cassandra/writer.rb', line 8 def attribute_filter_set @attribute_filter_set end |
#client ⇒ Object
Returns the value of attribute client
8 9 10 |
# File 'lib/pyper/pipes/cassandra/writer.rb', line 8 def client @client end |
#table_name ⇒ Object
Returns the value of attribute table_name
8 9 10 |
# File 'lib/pyper/pipes/cassandra/writer.rb', line 8 def table_name @table_name end |
Instance Method Details
#pipe(attributes, status = {}) ⇒ Hash
Returns The original attributes.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pyper/pipes/cassandra/writer.rb', line 13 def pipe(attributes, status = {}) attributes_to_write = if attribute_filter_set attributes.select { |k,v| attribute_filter_set.member?(k) } else attributes end client.insert(table_name, attributes_to_write) attributes end |