Class: Euston::Websites::ApiVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/euston-websites/api_version.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ ApiVersion

Returns a new instance of ApiVersion.



7
8
9
# File 'lib/euston-websites/api_version.rb', line 7

def initialize version
  @version = version
end

Instance Method Details

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/euston-websites/api_version.rb', line 11

def matches? request
  versioned_accept_header?(request) || version_one?(request)
end