Class: URITemplate::Colon::Token::Static

Inherits:
URITemplate::Colon::Token show all
Includes:
Literal
Defined in:
lib/uri_template/colon.rb

Constant Summary

Constants included from Literal

Literal::SLASH

Constants included from Token

Token::EMPTY_ARRAY

Instance Attribute Summary

Attributes included from Literal

#string

Instance Method Summary collapse

Methods included from Literal

#ends_with_slash?, #expand_partial, #expression?, #literal?, #size, #starts_with_slash?

Methods included from Token

#ends_with_slash?, #expand_partial, #host?, #scheme?, #size, #starts_with_slash?, #to_s, #variables

Constructor Details

#initialize(str) ⇒ Static

Returns a new instance of Static.



126
127
128
# File 'lib/uri_template/colon.rb', line 126

def initialize(str)
  @string = str
end

Instance Method Details

#expand(_) ⇒ Object



130
131
132
# File 'lib/uri_template/colon.rb', line 130

def expand(_)
  return @string
end

#to_rObject



134
135
136
# File 'lib/uri_template/colon.rb', line 134

def to_r
  return Regexp.escape(@string)
end