Class: HbaseAdapter::MutationList
- Inherits:
-
Object
- Object
- HbaseAdapter::MutationList
- Defined in:
- lib/hbase_adapter/mutation.rb
Instance Method Summary collapse
- #batch_mutation(key, &blk) ⇒ Object
- #delete(column) ⇒ Object
-
#initialize(&blk) ⇒ MutationList
constructor
A new instance of MutationList.
- #to_thrift ⇒ Object
- #update(column, value) ⇒ Object
Constructor Details
#initialize(&blk) ⇒ MutationList
Returns a new instance of MutationList.
37 38 39 40 41 |
# File 'lib/hbase_adapter/mutation.rb', line 37 def initialize(&blk) @mutations = [] self.instance_eval(&blk) end |
Instance Method Details
#batch_mutation(key, &blk) ⇒ Object
43 44 45 |
# File 'lib/hbase_adapter/mutation.rb', line 43 def batch_mutation(key, &blk) @mutations << BatchMutation.new(key, &blk) end |
#delete(column) ⇒ Object
51 52 53 |
# File 'lib/hbase_adapter/mutation.rb', line 51 def delete(column) @mutations << DeleteMutation.new(column) end |
#to_thrift ⇒ Object
55 56 57 |
# File 'lib/hbase_adapter/mutation.rb', line 55 def to_thrift @mutations.map {|m| m.to_thrift} end |
#update(column, value) ⇒ Object
47 48 49 |
# File 'lib/hbase_adapter/mutation.rb', line 47 def update(column, value) @mutations << UpdateMutation.new(column, value) end |