Class: Liminal::Openapi::ComponentsBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/liminal/openapi/components_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(document) ⇒ ComponentsBuilder

Returns a new instance of ComponentsBuilder.



6
7
8
# File 'lib/liminal/openapi/components_builder.rb', line 6

def initialize(document)
  @document = document
end

Instance Method Details

#register(name, schema, **compile_options) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/liminal/openapi/components_builder.rb', line 10

def register(name, schema, **compile_options)
  Liminal::Openapi.register(
    document: @document,
    name: name,
    schema: schema,
    **compile_options
  )
end

#register_contract(name, contract, **compile_options) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/liminal/openapi/components_builder.rb', line 19

def register_contract(name, contract, **compile_options)
  Liminal::Openapi.register_contract(
    document: @document,
    name: name,
    contract: contract,
    **compile_options
  )
end