Skip to content

Commit

Permalink
missing require for Table + a bit of doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Jan 28, 2009
1 parent 48e1d4f commit d0dbc5b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ The 'abstract' and the 'table' API are covered for now.

== usage

=== Abstract API

http://tokyocabinet.sourceforge.net/spex-en.html#tcadbapi

to create a hash (file named 'data.tch')

require 'rubygems'
Expand All @@ -34,14 +38,38 @@ to create a hash (file named 'data.tch')
db.close


=== Table API

http://tokyocabinet.sourceforge.net/spex-en.html#tctdbapi

require 'rubygems'
require 'rufus/tokyo/cabinet/table'

t = Rufus::Tokyo::Table.new('table.tdb', :create, :write)

t['pk0'] = { 'name' => 'alfred', 'age' => '22' }
t['pk1'] = { 'name' => 'bob', 'age' => '18' }
t['pk2'] = { 'name' => 'charly', 'age' => '45' }
t['pk3'] = { 'name' => 'doug', 'age' => '77' }
t['pk4'] = { 'name' => 'ephrem', 'age' => '32' }

p t.query { |q|
q.add_condition 'age', :eq, '32'
}

t.close


more in the rdoc

http://rufus.rubyforge.org/rufus-tokyo/
http://rufus.rubyforge.org/rufus-tokyo/classes/Rufus/Tokyo/Cabinet.html
http://rufus.rubyforge.org/rufus-tokyo/classes/Rufus/Tokyo/Table.html

or directly in the source

http://github.com/jmettraux/rufus-tokyo/blob/master/lib/rufus/tokyo/cabinet/abstract.rb
http://github.com/jmettraux/rufus-tokyo/blob/master/lib/rufus/tokyo/cabinet/table.rb


== Tokyo Cabinet install
Expand Down
5 changes: 5 additions & 0 deletions lib/rufus/tokyo/cabinet/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
# jmettraux@gmail.com
#

require 'rufus/tokyo/cabinet/lib'
require 'rufus/tokyo/cabinet/util'


module Rufus::Tokyo

Expand All @@ -37,6 +40,8 @@ module Rufus::Tokyo
# http://alpha.mixi.co.jp/blog/?p=290
# http://tokyocabinet.sourceforge.net/spex-en.html#tctdbapi
#
# TODO : rdoc me !
#
class Table
include CabinetLibMixin
include TokyoContainerMixin
Expand Down

0 comments on commit d0dbc5b

Please sign in to comment.