Module: Drillbit::Matchers::Generic

Included in:
AcceptHeader, Version
Defined in:
lib/drillbit/matchers/generic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accept_headerObject



26
27
28
# File 'lib/drillbit/matchers/generic.rb', line 26

def accept_header
  request.accept_header
end

#applicationObject



22
23
24
# File 'lib/drillbit/matchers/generic.rb', line 22

def application
  request.application_name
end

#requestObject

Returns the value of attribute request.



8
9
10
# File 'lib/drillbit/matchers/generic.rb', line 8

def request
  @request
end

Instance Method Details

#initialize(**args) ⇒ Object



12
13
14
15
16
# File 'lib/drillbit/matchers/generic.rb', line 12

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

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/drillbit/matchers/generic.rb', line 18

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