Class: KBBlob

Inherits:
Object show all
Defined in:
lib/kirbybase.rb

Overview


KBBlob

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(db, filepath, contents = '') ⇒ KBBlob


initialize



3389
3390
3391
3392
3393
# File 'lib/kirbybase.rb', line 3389

def initialize(db, filepath, contents='')
    @db = db
    @filepath = filepath
    @contents = contents
end

Instance Attribute Details

#contents ⇒ Object

Returns the value of attribute contents.



3384
3385
3386
# File 'lib/kirbybase.rb', line 3384

def contents
  @contents
end

#filepath ⇒ Object

Returns the value of attribute filepath.



3384
3385
3386
# File 'lib/kirbybase.rb', line 3384

def filepath
  @filepath
end

Instance Method Details

#read_from_file ⇒ Object


read_from_file



3398
3399
3400
# File 'lib/kirbybase.rb', line 3398

def read_from_file
    @contents = @db.engine.read_blob_file(@filepath)
end

#write_to_file ⇒ Object


write_to_file



3405
3406
3407
# File 'lib/kirbybase.rb', line 3405

def write_to_file
    @db.engine.write_blob_file(@filepath, @contents)
end