Class: Sruby::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/sruby/index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dbObject (readonly)

Returns the value of attribute db.



167
168
169
# File 'lib/sruby/index.rb', line 167

def db
  @db
end

#nameObject (readonly)

Returns the value of attribute name.



167
168
169
# File 'lib/sruby/index.rb', line 167

def name
  @name
end

Instance Method Details

#allObject



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

#insert(*values) ⇒ Object



174
175
176
# File 'lib/sruby/index.rb', line 174

def insert(*values)
  Database.new(@db).insert(@name, *values)
end

#update(*values) ⇒ Object



178
179
180
# File 'lib/sruby/index.rb', line 178

def update(*values)
  Database.new(@db).update(@name, *values)
end