lib/groonga/record.rb in groonga-0.0.1 vs lib/groonga/record.rb in groonga-0.0.2
- old
+ new
@@ -16,12 +16,17 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
module Groonga
class Record
attr_reader :table, :id
- def initialize(table, id)
+ def initialize(table, id, values=nil)
@table = table
@id = id
+ if values
+ values.each do |name, value|
+ self[name] = value
+ end
+ end
end
def ==(other)
self.class == other.class and
[table, id] == [other.table, other.id]