Class: KBTableRec

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

Overview


KBTableRec


Constant Summary

Constants included from KBTypeConversionsMixin

KBTypeConversionsMixin::ENCODE_RE, KBTypeConversionsMixin::KB_NIL, KBTypeConversionsMixin::UNENCODE_RE

Instance Method Summary collapse

Methods included from KBTypeConversionsMixin

#convert_to_encoded_string, #convert_to_native_type

Constructor Details

#initialize(tbl) ⇒ KBTableRec

Returns a new instance of KBTableRec.



3613
3614
3615
# File 'lib/kirbybase.rb', line 3613

def initialize(tbl)
    @tbl = tbl
end

Instance Method Details

#clearObject



3623
3624
3625
3626
3627
# File 'lib/kirbybase.rb', line 3623

def clear
    @tbl.field_names.each do |fn|
        send("#{fn}=", kb_nil)
    end
end

#populate(rec) ⇒ Object



3617
3618
3619
3620
3621
# File 'lib/kirbybase.rb', line 3617

def populate(rec)
    @tbl.field_names.zip(rec).each do |fn, val|
        send("#{fn}=", val)
    end
end