Class: Doze::URITemplate::String

Inherits:
Doze::URITemplate show all
Defined in:
lib/doze/uri_template.rb

Constant Summary collapse

NO_VARS =
[].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Doze::URITemplate

#+, #anchored_regexp, compile, #compile_expand!, #inspect, #match, #match_with_trailing, #parts, #start_anchored_regexp, #with_prefix

Constructor Details

#initialize(string) ⇒ String

Returns a new instance of String.



143
144
145
# File 'lib/doze/uri_template.rb', line 143

def initialize(string)
  @string = string
end

Instance Attribute Details

#stringObject (readonly)

Returns the value of attribute string.



141
142
143
# File 'lib/doze/uri_template.rb', line 141

def string
  @string
end

Instance Method Details

#expand(vars) ⇒ Object



155
156
157
# File 'lib/doze/uri_template.rb', line 155

def expand(vars)
  @string
end

#expand_code_fragmentObject



164
165
166
# File 'lib/doze/uri_template.rb', line 164

def expand_code_fragment
  @string.inspect[1...-1]
end

#partially_expand(vars) ⇒ Object



159
# File 'lib/doze/uri_template.rb', line 159

def partially_expand(vars); self; end

#regexp_fragmentObject



147
148
149
# File 'lib/doze/uri_template.rb', line 147

def regexp_fragment
  Regexp.escape(@string)
end

#to_sObject



151
152
153
# File 'lib/doze/uri_template.rb', line 151

def to_s
  @string
end

#variablesObject



162
# File 'lib/doze/uri_template.rb', line 162

def variables; NO_VARS; end