Sha256: b70d69e68c50e3d66150efc8587030a25f9dc23e533bc22b6336debc84e2ac74
Contents?: true
Size: 822 Bytes
Versions: 2
Compression:
Stored size: 822 Bytes
Contents
module VersionCake class VersionedRequest attr_reader :failed, :version def initialize(request, strategies, default_version=nil) @request, @strategies, @default_version, @failed = request, strategies, default_version, false end def execute begin extracted_version = extract_version if extracted_version.nil? @version = @default_version else @version = extracted_version end rescue VersionCake::ExtractionStrategy::InvalidVersionError @failed = true end end private def extract_version extracted_version = nil @strategies.each do |strategy| extracted_version = strategy.extract(@request) break unless extracted_version.nil? end extracted_version end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
versioncake-4.1.1 | lib/versioncake/versioned_request.rb |
versioncake-4.1.0 | lib/versioncake/versioned_request.rb |