Module Wrest::CoreExt::String::Conversions

  1. lib/wrest/core_ext/string/conversions.rb

Makes it easier to build other objects from a String This module is opt-out - if you don’t want the to_uri and to_uri_template convenience method on String, set the NoStringExtensions constant on the Wrest module before requiring wrest.

module Wrest
  NoStringExtensions = true
end
require 'wrest'

Methods

public instance

  1. to_uri
  2. to_uri_template

Public instance methods

to_uri (options = {})

A convenience method equivalent to Wrest::Uri.new(string)

[show source]
    # File lib/wrest/core_ext/string/conversions.rb, line 26
26:         def to_uri(options = {})
27:           Wrest::Uri.new(self.strip, options)
28:         end
to_uri_template (options = {})

A convenience method equivalent to Wrest:UriTemplate.new(uri_pattern)

[show source]
    # File lib/wrest/core_ext/string/conversions.rb, line 31
31:         def to_uri_template(options = {})
32:           Wrest::UriTemplate.new(self.strip, options)
33:         end