Module: LazyRecords

Defined in:
lib/record.rb,
lib/keyword.rb,
lib/definition.rb,
lib/sql_records.rb,
lib/memory_records.rb,
lib/predicate_to_sql.rb,
lib/sql_virtual_records.rb

Defined Under Namespace

Classes: Definition, Keyword, MemoryRecords, PredicateToSql, Record, SqlRecords, SqlVirtualRecords

Instance Method Summary collapse

Instance Method Details

#definition(name, *columns) ⇒ Object



3
4
5
# File 'lib/definition.rb', line 3

def definition(name, *columns)
  Definition.new(name, columns)
end

#keyword(name, encrypt = false) ⇒ Object



3
4
5
# File 'lib/keyword.rb', line 3

def keyword(name, encrypt=false)
  Keyword.new(name, encrypt)
end

#record(*data) ⇒ Object



3
4
5
# File 'lib/record.rb', line 3

def record(*data)
  Record.new(sequence(data).in_pairs.map { |r| {r.key.name => r.value} }.reduce({}) { |a, b| a.merge(b) })
end

#vrecord(*data) ⇒ Object



7
8
9
# File 'lib/record.rb', line 7

def vrecord(*data)
  Record.new(sequence(data).in_pairs.map { |r| {r.key => r.value} }.reduce({}) { |a, b| a.merge(b) })
end