Class: VersionCake::ResponseStrategy::Base
- Inherits:
-
Object
- Object
- VersionCake::ResponseStrategy::Base
show all
- Defined in:
- lib/versioncake/response_strategy/base.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.lookup(strategy) ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/versioncake/response_strategy/base.rb', line 12
def self.lookup(strategy)
case strategy
when String, Symbol
strategy_name = "#{strategy}_strategy".camelize
begin
VersionCake::ResponseStrategy.const_get(strategy_name).new
rescue
raise Exception, "Unknown VersionCake response strategy #{strategy_name}"
end
else
raise Exception, "Invalid response strategy"
end
end
|
Instance Method Details
#execute(_context, _status, _headers, _response) ⇒ Object
4
5
6
|
# File 'lib/versioncake/response_strategy/base.rb', line 4
def execute(_context, _status, , _response)
raise Exception, "ResponseStrategy requires execute to be implemented"
end
|
#version_key ⇒ Object
8
9
10
|
# File 'lib/versioncake/response_strategy/base.rb', line 8
def version_key
VersionCake.config.version_key
end
|