Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/red_query/string.rb

Overview

useful web extensions for strings

Instance Method Summary collapse

Instance Method Details

#substr(index, length) ⇒ Object



11
12
13
# File 'lib/red_query/string.rb', line 11

def substr(index, length)
  String.new(`#{self}.__value__.substr(#{index}, #{length})`)
end

#to_uri_componentObject

encodes string to URI-Component



7
8
9
# File 'lib/red_query/string.rb', line 7

def to_uri_component
  String.new(`encodeURIComponent(#{self}.__value__)`)
end