Module: URITemplate::Literal
Overview
A module which all literal tokens should include.
Constant Summary
collapse
- SLASH =
?/
Constants included
from Token
Token::EMPTY_ARRAY
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Token
#host?, #scheme?, #variables
Instance Attribute Details
#string ⇒ Object
Also known as:
to_s
Returns the value of attribute string.
31
32
33
|
# File 'lib/uri_template/literal.rb', line 31
def string
@string
end
|
Instance Method Details
#ends_with_slash? ⇒ Boolean
57
58
59
|
# File 'lib/uri_template/literal.rb', line 57
def ends_with_slash?
string[-1] == SLASH
end
|
#expand(_) ⇒ Object
45
46
47
|
# File 'lib/uri_template/literal.rb', line 45
def expand(_)
return string
end
|
#expand_partial(_) ⇒ Object
49
50
51
|
# File 'lib/uri_template/literal.rb', line 49
def expand_partial(_)
return [self]
end
|
#expression? ⇒ Boolean
37
38
39
|
# File 'lib/uri_template/literal.rb', line 37
def expression?
false
end
|
#literal? ⇒ Boolean
33
34
35
|
# File 'lib/uri_template/literal.rb', line 33
def literal?
true
end
|
#size ⇒ Object
41
42
43
|
# File 'lib/uri_template/literal.rb', line 41
def size
0
end
|
#starts_with_slash? ⇒ Boolean
53
54
55
|
# File 'lib/uri_template/literal.rb', line 53
def starts_with_slash?
string[0] == SLASH
end
|