class Versionist::VersioningStrategy::Path

Implements the path versioning strategy. It expects the following path format: GET /<version>/…

Public Class Methods

new(config) click to toggle source

Creates a new Path VersioningStrategy object. config must contain the following keys:

  • :path the path prefix containing the version

# File lib/versionist/versioning_strategy/path.rb, line 9
def initialize(config)
  super
  raise ArgumentError, "you must specify :value in the :path configuration Hash" if !config[:path].has_key?(:value)
  Versionist.configuration.path_versions << self if !Versionist.configuration.path_versions.include?(self)
end

Public Instance Methods

==(other) click to toggle source
Calls superclass method Versionist::VersioningStrategy::Base#==
# File lib/versionist/versioning_strategy/path.rb, line 15
def ==(other)
  super
  return false if !other.is_a?(Versionist::VersioningStrategy::Path)
  return self.config[:path][:value] == other.config[:path][:value]
end