Class: KDL::Types::URLTemplate::StringExpansion
- Defined in:
- lib/kdl/types/url_template.rb
Direct Known Subclasses
FragmentExpansion, LabelExpansion, ParameterExpansion, PathExpansion, QueryExpansion, ReservedExpansion
Instance Method Summary collapse
- #expand(values) ⇒ Object
-
#initialize(variables) ⇒ StringExpansion
constructor
A new instance of StringExpansion.
Methods inherited from Part
allow_reserved?, #expand_variables, keep_empties?, #prefix, #separator, with_name?
Constructor Details
#initialize(variables) ⇒ StringExpansion
Returns a new instance of StringExpansion.
241 242 243 244 |
# File 'lib/kdl/types/url_template.rb', line 241 def initialize(variables) super() @variables = variables end |
Instance Method Details
#expand(values) ⇒ Object
246 247 248 249 250 251 |
# File 'lib/kdl/types/url_template.rb', line 246 def (values) = (values) return '' if .empty? prefix + .join(separator) end |