Module: RIO::IF::String

Included in:
Rio
Defined in:
lib/rio/if/string.rb

Instance Method Summary collapse

Instance Method Details

#+(arg) ⇒ Object

Create a Rio referencing Rio#to_str + arg.to_str

rio('afile') + '-0.1'   #=> rio('afile-0.1')


53
# File 'lib/rio/if/string.rb', line 53

def +(arg) target + arg end

#gsub(re, string) ⇒ Object

Create a new Rio referencing the result of applying ::String#gsub to the value returned by Rio#to_s. So:

ario.gsub(re,string)

is equivelent to

rio(ario.to_s.gsub(re,string))

See also #sub #+



73
# File 'lib/rio/if/string.rb', line 73

def gsub(re,string) target.gsub(re,string) end

#sub(re, string) ⇒ Object

Create a new Rio referencing the result of applying ::String#sub to the value returned by Rio#to_s. So:

ario.sub(re,string)

is equivelent to

rio(ario.to_s.sub(re,string))

See also #gsub, #+



63
# File 'lib/rio/if/string.rb', line 63

def sub(re,string) target.sub(re,string) end