module Loba::Internal
@api private
Public Class Methods
unquote(content)
click to toggle source
Remove wrapping quotes on a string (produced by .inspect)
@param argument [String] the string (assumed to be produced from calling .inspect)
to remove quotes (") that wrap a string
@return [String, Object]
* If not a string, the original argument will be returned without modification * If string does not have quotes as first and last character, the original argument will be returned without modification * If string does have quotes as first and last character, the original content will be returned with the original first and last character removed
# File lib/loba/internal.rb, line 19 def unquote(content) return content unless content.is_a?(String) return content unless content[0] == '"' && content[-1] == '"' content[1...-1] end
Private Instance Methods
unquote(content)
click to toggle source
Remove wrapping quotes on a string (produced by .inspect)
@param argument [String] the string (assumed to be produced from calling .inspect)
to remove quotes (") that wrap a string
@return [String, Object]
* If not a string, the original argument will be returned without modification * If string does not have quotes as first and last character, the original argument will be returned without modification * If string does have quotes as first and last character, the original content will be returned with the original first and last character removed
# File lib/loba/internal.rb, line 19 def unquote(content) return content unless content.is_a?(String) return content unless content[0] == '"' && content[-1] == '"' content[1...-1] end