Class: Apill::Matchers::AcceptHeaderMatcher

Inherits:
Object
  • Object
show all
Includes:
GenericMatcher
Defined in:
lib/apill/matchers/accept_header_matcher.rb

Direct Known Subclasses

InvalidApiRequestMatcher

Instance Attribute Summary

Attributes included from GenericMatcher

#accept_header, #application

Instance Method Summary collapse

Methods included from GenericMatcher

#initialize

Instance Method Details

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
# File 'lib/apill/matchers/accept_header_matcher.rb', line 8

def matches?(request)
  super

  request.subdomains.first == 'api' &&
  accept_header.valid?
end