Class: WCC::Contentful::ModelBuilder
- Inherits:
-
Object
- Object
- WCC::Contentful::ModelBuilder
- Includes:
- Helpers
- Defined in:
- lib/wcc/contentful/model_builder.rb
Instance Attribute Summary collapse
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
Instance Method Summary collapse
- #build_models ⇒ Object
-
#initialize(types, namespace: WCC::Contentful::Model) ⇒ ModelBuilder
constructor
A new instance of ModelBuilder.
Methods included from Helpers
#constant_from_content_type, #content_type_from_constant, #content_type_from_raw, #shared_prefix
Constructor Details
#initialize(types, namespace: WCC::Contentful::Model) ⇒ ModelBuilder
Returns a new instance of ModelBuilder.
14 15 16 17 |
# File 'lib/wcc/contentful/model_builder.rb', line 14 def initialize(types, namespace: WCC::Contentful::Model) @types = types @namespace = namespace end |
Instance Attribute Details
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
12 13 14 |
# File 'lib/wcc/contentful/model_builder.rb', line 12 def namespace @namespace end |
Instance Method Details
#build_models ⇒ Object
19 20 21 22 23 |
# File 'lib/wcc/contentful/model_builder.rb', line 19 def build_models @types.each_with_object([]) do |(_k, v), a| a << build_model(v) end end |