Skip to content

Commit

Permalink
allow multiple versioning strategies simultaneously
Browse files Browse the repository at this point in the history
  • Loading branch information
twinge committed Jul 23, 2012
1 parent 7ecfb90 commit 2ae857a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/versionist/routing.rb
Expand Up @@ -14,10 +14,12 @@ def api_version(config, &block)
raise ArgumentError, "you must specify :header, :path, or :parameter in configuration Hash passed to api_version" if !config.has_key?(:header) && !config.has_key?(:path) && !config.has_key?(:parameter)
raise ArgumentError, ":defaults must be a Hash" if config.has_key?(:defaults) && !config[:defaults].is_a?(Hash)
if config.has_key?(:header)
return configure_header(config, &block)
elsif config.has_key?(:path)
return configure_path(config, &block)
elsif config.has_key?(:parameter)
configure_header(config, &block)
end
if config.has_key?(:path)
configure_path(config, &block)
end
if config.has_key?(:parameter)
configure_parameter(config, &block)
end
end
Expand Down

0 comments on commit 2ae857a

Please sign in to comment.