Class: KBMemo

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

Overview


KBMemo


Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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


initialize




3358
3359
3360
3361
3362
# File 'lib/kirbybase.rb', line 3358

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

Instance Attribute Details

#contentsObject

Returns the value of attribute contents.



3353
3354
3355
# File 'lib/kirbybase.rb', line 3353

def contents
  @contents
end

#filepathObject

Returns the value of attribute filepath.



3353
3354
3355
# File 'lib/kirbybase.rb', line 3353

def filepath
  @filepath
end

Instance Method Details

#read_from_fileObject


read_from_file




3367
3368
3369
# File 'lib/kirbybase.rb', line 3367

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

#write_to_fileObject


write_to_file




3374
3375
3376
# File 'lib/kirbybase.rb', line 3374

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