Class: Riak::TimeSeries::Read

Inherits:
Object
  • Object
show all
Defined in:
lib/riak/time_series/read.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, table_name) ⇒ Read

Returns a new instance of Read.



21
22
23
24
# File 'lib/riak/time_series/read.rb', line 21

def initialize(client, table_name)
  @client = client
  @table_name = table_name
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



18
19
20
# File 'lib/riak/time_series/read.rb', line 18

def client
  @client
end

#keyObject

Returns the value of attribute key.



17
18
19
# File 'lib/riak/time_series/read.rb', line 17

def key
  @key
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



19
20
21
# File 'lib/riak/time_series/read.rb', line 19

def table_name
  @table_name
end

Instance Method Details

#read!Object



26
27
28
29
30
31
# File 'lib/riak/time_series/read.rb', line 26

def read!
  client.backend do |be|
    op = be.time_series_get_operator(client.convert_timestamp)
    op.get(table_name, key)
  end
end