Class: Spyke::Path
- Inherits:
-
Object
- Object
- Spyke::Path
- Defined in:
- lib/spyke/path.rb
Instance Method Summary collapse
-
#initialize(pattern, params = {}) ⇒ Path
constructor
A new instance of Path.
- #join(other_path) ⇒ Object
- #to_s ⇒ Object
- #variables ⇒ Object
Constructor Details
#initialize(pattern, params = {}) ⇒ Path
Returns a new instance of Path.
7 8 9 10 |
# File 'lib/spyke/path.rb', line 7 def initialize(pattern, params = {}) @pattern = pattern @params = params.symbolize_keys end |
Instance Method Details
#join(other_path) ⇒ Object
12 13 14 |
# File 'lib/spyke/path.rb', line 12 def join(other_path) self.class.new File.join(path, other_path.to_s), @params end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/spyke/path.rb', line 16 def to_s path end |
#variables ⇒ Object
20 21 22 |
# File 'lib/spyke/path.rb', line 20 def variables @variables ||= uri_template.variables.map(&:to_sym) end |