Class: ApiSketch::DSL::ComplexAttributeParser

Inherits:
AttributeParser show all
Defined in:
lib/api_sketch/dsl/complex_attribute_parser.rb

Instance Method Summary collapse

Methods inherited from AttributeParser

#initialize, #to_h

Methods inherited from Base

#use_shared_block

Constructor Details

This class inherits a constructor from ApiSketch::DSL::AttributeParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *arguments, &block) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/api_sketch/dsl/complex_attribute_parser.rb', line 3

def method_missing(method_name, *arguments, &block)
  if method_name == :content
    @attribute_values[:content] = ApiSketch::DSL::Attributes.new(@container_type, &block).to_a
  else
    super(method_name, *arguments, &block)
  end
end