Class: WCC::Contentful::ModelBuilder

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/wcc/contentful/model_builder.rb

Instance Method Summary collapse

Methods included from Helpers

#constant_from_content_type, #content_type_from_constant, #content_type_from_raw, #shared_prefix

Constructor Details

#initialize(types) ⇒ ModelBuilder

Returns a new instance of ModelBuilder.



9
10
11
# File 'lib/wcc/contentful/model_builder.rb', line 9

def initialize(types)
  @types = types
end

Instance Method Details

#build_modelsObject



13
14
15
16
17
# File 'lib/wcc/contentful/model_builder.rb', line 13

def build_models
  @types.each_with_object([]) do |(_k, v), a|
    a << build_model(v)
  end
end