Class: Doze::URITemplate::Composite
Instance Attribute Summary collapse
Instance Method Summary
collapse
#+, #anchored_regexp, compile, #compile_expand!, #inspect, #match, #match_with_trailing, #start_anchored_regexp, #with_prefix
Constructor Details
#initialize(parts) ⇒ Composite
Returns a new instance of Composite.
170
171
172
|
# File 'lib/doze/uri_template.rb', line 170
def initialize(parts)
@parts = parts
end
|
Instance Attribute Details
#parts ⇒ Object
Returns the value of attribute parts.
198
199
200
|
# File 'lib/doze/uri_template.rb', line 198
def parts
@parts
end
|
Instance Method Details
#expand(vars) ⇒ Object
182
183
184
|
# File 'lib/doze/uri_template.rb', line 182
def expand(vars)
@parts.map {|p| p.expand(vars)}.join
end
|
#expand_code_fragment ⇒ Object
194
195
196
|
# File 'lib/doze/uri_template.rb', line 194
def expand_code_fragment
@parts.map {|p| p.expand_code_fragment}.join
end
|
#partially_expand(vars) ⇒ Object
186
187
188
|
# File 'lib/doze/uri_template.rb', line 186
def partially_expand(vars)
Composite.new(@parts.map {|p| p.partially_expand(vars)})
end
|
#regexp_fragment ⇒ Object
174
175
176
|
# File 'lib/doze/uri_template.rb', line 174
def regexp_fragment
@parts.map {|p| p.regexp_fragment}.join
end
|
#to_s ⇒ Object
178
179
180
|
# File 'lib/doze/uri_template.rb', line 178
def to_s
@parts.join
end
|
#variables ⇒ Object
190
191
192
|
# File 'lib/doze/uri_template.rb', line 190
def variables
@variables ||= @parts.map {|p| p.variables}.flatten
end
|