Class: VersionCake::ResponseStrategy::HttpHeaderStrategy

Inherits:
Base
  • Object
show all
Defined in:
lib/versioncake/response_strategy/http_header_strategy.rb

Instance Method Summary collapse

Methods inherited from Base

lookup, #version_key

Instance Method Details

#execute(context, _status, headers, _response) ⇒ Object



4
5
6
# File 'lib/versioncake/response_strategy/http_header_strategy.rb', line 4

def execute(context, _status, headers, _response)
  headers[header_key] = context.version.to_s
end

#header_keyObject



8
9
10
# File 'lib/versioncake/response_strategy/http_header_strategy.rb', line 8

def header_key
  version_key.gsub('_', '-')
end