Class: OpenapiContracts::PayloadParser::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/openapi_contracts/payload_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#matcherObject

Returns the value of attribute matcher

Returns:

  • (Object)

    the current value of matcher



11
12
13
# File 'lib/openapi_contracts/payload_parser.rb', line 11

def matcher
  @matcher
end

#parserObject

Returns the value of attribute parser

Returns:

  • (Object)

    the current value of parser



11
12
13
# File 'lib/openapi_contracts/payload_parser.rb', line 11

def parser
  @parser
end

Instance Method Details

#call(raw) ⇒ Object



12
13
14
# File 'lib/openapi_contracts/payload_parser.rb', line 12

def call(raw)
  parser.call(raw)
end

#match?(media_type) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/openapi_contracts/payload_parser.rb', line 16

def match?(media_type)
  matcher == media_type || matcher.match?(media_type)
end