Module: Apill::Matchers::GenericMatcher

Included in:
AcceptHeaderMatcher, VersionMatcher
Defined in:
lib/apill/matchers/generic_matcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accept_headerObject

Returns the value of attribute accept_header.



7
8
9
# File 'lib/apill/matchers/generic_matcher.rb', line 7

def accept_header
  @accept_header
end

#applicationObject

Returns the value of attribute application.



7
8
9
# File 'lib/apill/matchers/generic_matcher.rb', line 7

def application
  @application
end

Instance Method Details

#initialize(**args) ⇒ Object



10
11
12
13
14
# File 'lib/apill/matchers/generic_matcher.rb', line 10

def initialize(**args)
  args.each do |variable, value|
    send("#{variable}=", value)
  end
end

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
20
# File 'lib/apill/matchers/generic_matcher.rb', line 16

def matches?(request)
  request            = Requests::Base.resolve(request)
  self.application   = request.application_name
  self.accept_header = request.accept_header
end