class GrnMini::Array
Public Class Methods
new(name = "Array")
click to toggle source
Calls superclass method
# File lib/grn_mini/array.rb, line 7 def initialize(name = "Array") super(name, Groonga[name] || Groonga::Array.create(name: name, persistent: true), ) end
Public Instance Methods
[](id)
click to toggle source
# File lib/grn_mini/array.rb, line 22 def [](id) raise IdIsGreaterThanZero if id == 0 @grn[id] end
add(hash)
click to toggle source
# File lib/grn_mini/array.rb, line 13 def add(hash) setup_columns(hash) if need_setup_columns? @grn.add(hash) end
Also aliased as: <<
delete(id = nil, &block)
click to toggle source
# File lib/grn_mini/array.rb, line 27 def delete(id = nil, &block) if block_given? @grn.delete(&block) else raise IdIsGreaterThanZero if id == 0 @grn.delete(id) end end