Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/tebako-runtime/string.rb

Overview

Quote/unquote add-on for String class

Instance Method Summary collapse

Instance Method Details

#quoteObject



38
39
40
# File 'lib/tebako-runtime/string.rb', line 38

def quote
  "\"#{self}\""
end

#quoted?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/tebako-runtime/string.rb', line 30

def quoted?
  start_with?('"') && end_with?('"')
end

#unquoteObject



34
35
36
# File 'lib/tebako-runtime/string.rb', line 34

def unquote
  chomp('"').reverse.chomp('"').reverse
end