Class: Riak::TimeSeries::Submission
- Defined in:
- lib/riak/time_series/submission.rb
Instance Attribute Summary collapse
-
#client ⇒ Riak::Client
readonly
The client to write submissions to.
-
#measurements ⇒ Array<Array<Object>>
Measurements to write to Riak TS.
-
#table_name ⇒ String
readonly
The table name to write submissions to.
Instance Method Summary collapse
-
#initialize(client, table_name) ⇒ Submission
constructor
Initializes the submission object with a client and table name.
-
#write! ⇒ Object
Write the submitted data to Riak.
Constructor Details
#initialize(client, table_name) ⇒ Submission
Initializes the submission object with a client and table name
20 21 22 23 |
# File 'lib/riak/time_series/submission.rb', line 20 def initialize(client, table_name) @client = client @table_name = table_name end |
Instance Attribute Details
#client ⇒ Riak::Client (readonly)
Returns the client to write submissions to.
10 11 12 |
# File 'lib/riak/time_series/submission.rb', line 10 def client @client end |
#measurements ⇒ Array<Array<Object>>
Returns measurements to write to Riak TS.
6 7 8 |
# File 'lib/riak/time_series/submission.rb', line 6 def measurements @measurements end |
#table_name ⇒ String (readonly)
Returns the table name to write submissions to.
14 15 16 |
# File 'lib/riak/time_series/submission.rb', line 14 def table_name @table_name end |
Instance Method Details
#write! ⇒ Object
Write the submitted data to Riak.
26 27 28 29 30 |
# File 'lib/riak/time_series/submission.rb', line 26 def write! client.backend do |be| be.time_series_put_operator.put(table_name, measurements) end end |