Module: URITemplate::Token Abstract
- Included in:
- Expression, Literal
- Defined in:
- lib/uri_template/token.rb
Overview
This module is abstract.
This should make it possible to do basic analysis independently from the concrete type. Usually the submodules Literal and Expression are used.
Constant Summary collapse
- EMPTY_ARRAY =
[].freeze
Instance Method Summary collapse
- #ends_with_slash? ⇒ Boolean
- #expand(variables) ⇒ Object abstract
- #expand_partial(variables) ⇒ Object abstract
- #host? ⇒ Boolean
- #scheme? ⇒ Boolean
-
#size ⇒ Object
Number of variables in this token.
- #starts_with_slash? ⇒ Boolean
- #to_s ⇒ Object abstract
-
#variables ⇒ Array<String>
The variable names used in this token.
Instance Method Details
#ends_with_slash? ⇒ Boolean
48 49 50 |
# File 'lib/uri_template/token.rb', line 48 def ends_with_slash? false end |
#expand(variables) ⇒ Object
This method is abstract.
61 62 63 |
# File 'lib/uri_template/token.rb', line 61 def (variables) raise "Please implement #expand(variables) on #{self.class.inspect}." end |
#expand_partial(variables) ⇒ Object
This method is abstract.
66 67 68 |
# File 'lib/uri_template/token.rb', line 66 def (variables) raise "Please implement #expand_partial(variables) on #{self.class.inspect}." end |
#host? ⇒ Boolean
56 57 58 |
# File 'lib/uri_template/token.rb', line 56 def host? false end |
#scheme? ⇒ Boolean
52 53 54 |
# File 'lib/uri_template/token.rb', line 52 def scheme? false end |
#size ⇒ Object
Number of variables in this token
40 41 42 |
# File 'lib/uri_template/token.rb', line 40 def size variables.size end |
#starts_with_slash? ⇒ Boolean
44 45 46 |
# File 'lib/uri_template/token.rb', line 44 def starts_with_slash? false end |
#to_s ⇒ Object
This method is abstract.
71 72 73 |
# File 'lib/uri_template/token.rb', line 71 def to_s raise "Please implement #to_s on #{self.class.inspect}." end |
#variables ⇒ Array<String>
The variable names used in this token.
35 36 37 |
# File 'lib/uri_template/token.rb', line 35 def variables EMPTY_ARRAY end |