Class: Vend::PathBuilder
- Inherits:
-
Object
- Object
- Vend::PathBuilder
- Defined in:
- lib/vend/request.rb
Instance Attribute Summary collapse
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #build(key = nil) ⇒ Object
-
#initialize(uri) ⇒ PathBuilder
constructor
A new instance of PathBuilder.
- #to_s ⇒ Object
Constructor Details
#initialize(uri) ⇒ PathBuilder
Returns a new instance of PathBuilder.
7 8 9 |
# File 'lib/vend/request.rb', line 7 def initialize(uri) @uri = uri end |
Instance Attribute Details
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
5 6 7 |
# File 'lib/vend/request.rb', line 5 def uri @uri end |
Instance Method Details
#build(key = nil) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/vend/request.rb', line 11 def build(key = nil) if key "#{uri}/#{key}" else uri end end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/vend/request.rb', line 19 def to_s @uri end |