Class: Sruby::Table
- Inherits:
-
Object
- Object
- Sruby::Table
- Defined in:
- lib/sruby/index.rb
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #all ⇒ Object
- #delete(name, path = nil) ⇒ Object
- #get(name, path = nil) ⇒ Object
-
#initialize(db, name) ⇒ Table
constructor
A new instance of Table.
- #insert(*values) ⇒ Object
- #update(*values) ⇒ Object
Constructor Details
#initialize(db, name) ⇒ Table
Returns a new instance of Table.
169 170 171 172 |
# File 'lib/sruby/index.rb', line 169 def initialize(db, name) @db = db @name = name end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
167 168 169 |
# File 'lib/sruby/index.rb', line 167 def db @db end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
167 168 169 |
# File 'lib/sruby/index.rb', line 167 def name @name end |
Instance Method Details
#all ⇒ Object
190 191 192 |
# File 'lib/sruby/index.rb', line 190 def all Database.new(@db).all(@name) end |
#delete(name, path = nil) ⇒ Object
186 187 188 |
# File 'lib/sruby/index.rb', line 186 def delete(name, path = nil) Database.new(@db).delete(@name, name, path) end |
#get(name, path = nil) ⇒ Object
182 183 184 |
# File 'lib/sruby/index.rb', line 182 def get(name, path = nil) Database.new(@db).get(@name, name, path) end |