Class: Materialize::BaseBuilder
- Inherits:
-
Object
- Object
- Materialize::BaseBuilder
- Extended by:
- Concurrent
- Defined in:
- lib/materialize/base_builder.rb
Class Method Summary collapse
- .build(data, repo, options) ⇒ Object
- .build_all(data, repo, options) ⇒ Object
- .entity_class ⇒ Object
Methods included from Concurrent
Class Method Details
.build(data, repo, options) ⇒ Object
6 7 8 9 |
# File 'lib/materialize/base_builder.rb', line 6 def build(data, repo, ) data = data.merge({ __repo__: repo, __options__: }) entity_class.new(data) end |
.build_all(data, repo, options) ⇒ Object
11 12 13 14 |
# File 'lib/materialize/base_builder.rb', line 11 def build_all(data, repo, ) datas = data.map { |d| d.merge({ __repo__: repo, __options__: }) } entity_class.wrap(datas) end |
.entity_class ⇒ Object
16 17 18 |
# File 'lib/materialize/base_builder.rb', line 16 def entity_class "Entities::#{entity_base_class_name}".split('::').reduce(Module, :const_get) end |