Class: Conformist::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/conformist/builder.rb

Class Method Summary collapse

Class Method Details

.call(schema, enumerable, context = nil) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/conformist/builder.rb', line 3

def self.call schema, enumerable, context = nil
  columns = schema.columns
  hash = columns.each_with_object({}) do |column, hash|
    hash[column.name] = column.values_in(enumerable, context)
  end
  HashStruct.new hash
end