Class: KDL::Types::URLTemplate::Part

Inherits:
Object
  • Object
show all
Defined in:
lib/kdl/types/url_template.rb

Direct Known Subclasses

StringExpansion, StringLiteral

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.allow_reserved?Boolean

Returns:



216
217
218
# File 'lib/kdl/types/url_template.rb', line 216

def self.allow_reserved?
  false
end

.keep_empties?Boolean

Returns:



224
225
226
# File 'lib/kdl/types/url_template.rb', line 224

def self.keep_empties?
  false
end

.with_name?Boolean

Returns:



220
221
222
# File 'lib/kdl/types/url_template.rb', line 220

def self.with_name?
  false
end

Instance Method Details

#expand_variables(values) ⇒ Object



201
202
203
204
205
206
# File 'lib/kdl/types/url_template.rb', line 201

def expand_variables(values)
  @variables.reduce([]) do |list, variable|
    expanded = variable.expand(values[variable.name])
    expanded ? list + expanded : list
  end
end

#prefixObject



212
213
214
# File 'lib/kdl/types/url_template.rb', line 212

def prefix
  ''
end

#separatorObject



208
209
210
# File 'lib/kdl/types/url_template.rb', line 208

def separator
  ','
end