Class: OpenapiContracts::Doc::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi_contracts/doc/header.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, data) ⇒ Header

Returns a new instance of Header.



5
6
7
8
# File 'lib/openapi_contracts/doc/header.rb', line 5

def initialize(name, data)
  @name = name
  @data = data
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/openapi_contracts/doc/header.rb', line 3

def name
  @name
end

Instance Method Details

#required?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/openapi_contracts/doc/header.rb', line 10

def required?
  @data['required']
end

#schemaObject



14
15
16
# File 'lib/openapi_contracts/doc/header.rb', line 14

def schema
  @data['schema']
end