class Lingo::Database::Source::KeyValue
Constants
- DEFAULT_DEF_WC
- DEFAULT_SEPARATOR
Public Class Methods
new(*)
click to toggle source
Calls superclass method
# File lib/lingo/database/source/key_value.rb, line 45 def initialize(*) super @pat = /^(#{@wrd})#{Regexp.escape(@sep)}(#{@wrd})$/ end
Public Instance Methods
dump_line(key, val, sep = @sep, *)
click to toggle source
# File lib/lingo/database/source/key_value.rb, line 54 def dump_line(key, val, sep = @sep, *) val.map(&:form).unshift(key).join(sep) end
parse_line(line, key, val)
click to toggle source
# File lib/lingo/database/source/key_value.rb, line 50 def parse_line(line, key, val) [key.strip, [lexical(val.strip, @def)]] end