Sha256: 14240ca0a970c85bbaef45aadfdb313a985b12c1a1bdc6e6f52507f8edae513e
Contents?: true
Size: 501 Bytes
Versions: 13
Compression:
Stored size: 501 Bytes
Contents
require 'uri_template' module Spyke class Path def initialize(uri_template, params = {}) @uri_template = URITemplate.new(:colon, uri_template) @params = params end def join(other_path) self.class.new File.join(path, other_path.to_s), @params end def to_s path end def variables @variables ||= @uri_template.variables.map(&:to_sym) end private def path @uri_template.expand(@params).chomp('/') end end end
Version data entries
13 entries across 13 versions & 1 rubygems