Class: URITemplate::RFC6570::Literal
- Includes:
- Literal
- Defined in:
- lib/uri_template/rfc6570.rb
Constant Summary
Constants included from Literal
Constants included from Token
Instance Attribute Summary
Attributes included from Literal
Instance Method Summary collapse
-
#initialize(string) ⇒ Literal
constructor
A new instance of Literal.
- #level ⇒ Object
- #to_r_source(*_) ⇒ Object
- #to_s ⇒ Object
Methods included from Literal
#ends_with_slash?, #expand, #expand_partial, #expression?, #literal?, #size, #starts_with_slash?
Methods included from Token
#ends_with_slash?, #expand, #expand_partial, #host?, #scheme?, #size, #starts_with_slash?, #variables
Constructor Details
#initialize(string) ⇒ Literal
Returns a new instance of Literal.
171 172 173 |
# File 'lib/uri_template/rfc6570.rb', line 171 def initialize(string) @string = string end |
Instance Method Details
#level ⇒ Object
175 176 177 |
# File 'lib/uri_template/rfc6570.rb', line 175 def level 1 end |
#to_r_source(*_) ⇒ Object
179 180 181 |
# File 'lib/uri_template/rfc6570.rb', line 179 def to_r_source(*_) Regexp.escape(@string) end |
#to_s ⇒ Object
183 184 185 |
# File 'lib/uri_template/rfc6570.rb', line 183 def to_s @string end |