Class: Trane::BodyBuilder

Inherits:
FieldBuilder show all
Defined in:
lib/trane/operation_definition.rb

Overview

Builder for the body do ... end block inside a request. Extends FieldBuilder to accept the required: kwarg on body fields.

Instance Attribute Summary

Attributes inherited from FieldBuilder

#fields

Instance Method Summary collapse

Methods inherited from FieldBuilder

#initialize

Constructor Details

This class inherits a constructor from Trane::FieldBuilder

Instance Method Details

#field(name, type: nil, extra: false, format: nil, of: nil, required: false, enum: nil, &block) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/trane/operation_definition.rb', line 40

def field(name, type: nil, extra: false, format: nil, of: nil, required: false, enum: nil, &block)
  @fields << _build_field_node(
    name: name, type: type, extra: extra, format: format,
    of: of, enum: enum, child_builder_class: BodyBuilder,
    required: required, &block
  )
end