Class: Apill::Matchers::VersionMatcher

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

Instance Attribute Summary collapse

Attributes included from GenericMatcher

#accept_header, #application

Instance Method Summary collapse

Methods included from GenericMatcher

#initialize

Instance Attribute Details

#default_version=(value) ⇒ Object

Sets the attribute default_version

Parameters:

  • value

    the value to set the attribute default_version to.



9
10
11
# File 'lib/apill/matchers/version_matcher.rb', line 9

def default_version=(value)
  @default_version = value
end

#version_constraintObject

Returns the value of attribute version_constraint.



9
10
11
# File 'lib/apill/matchers/version_matcher.rb', line 9

def version_constraint
  @version_constraint
end

Instance Method Details

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
16
# File 'lib/apill/matchers/version_matcher.rb', line 12

def matches?(request)
  super

  requested_version == version_constraint
end