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.



7
8
9
10
# File 'lib/riak/time_series/read.rb', line 7

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

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



4
5
6
# File 'lib/riak/time_series/read.rb', line 4

def client
  @client
end

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/riak/time_series/read.rb', line 3

def key
  @key
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



5
6
7
# File 'lib/riak/time_series/read.rb', line 5

def table_name
  @table_name
end

Instance Method Details

#read!Object



12
13
14
15
16
17
# File 'lib/riak/time_series/read.rb', line 12

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