class Materialize::BaseBuilder
Public Class Methods
build(data, repo, options)
click to toggle source
# File lib/materialize/base_builder.rb, line 6 def build(data, repo, options) data = data.merge({ __repo__: repo, __options__: options }) entity_class.new(data) end
build_all(data, repo, options)
click to toggle source
# File lib/materialize/base_builder.rb, line 11 def build_all(data, repo, options) datas = data.map { |d| d.merge({ __repo__: repo, __options__: options }) } entity_class.wrap(datas) end
entity_class()
click to toggle source
# File lib/materialize/base_builder.rb, line 16 def entity_class "Entities::#{entity_base_class_name}".split('::').reduce(Module, :const_get) end
Private Class Methods
entity_base_class_name()
click to toggle source
# File lib/materialize/base_builder.rb, line 22 def entity_base_class_name "#{self.name[0..-8]}".split('::').last end