Class: String

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

Direct Known Subclasses

Path

Instance Method Summary collapse

Instance Method Details

#substitute(binding) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/RubyExt/string.rb', line 14

def substitute binding
	binding.should! :be_a, Binding
	return gsub(/\#\{.+?\}/) do |term|
		identifier = term.slice(2 .. term.size-2)
		binding.eval identifier
	end
end

#to_ivObject



10
11
12
# File 'lib/RubyExt/string.rb', line 10

def to_iv
	"@#{self}"
end

#to_readerObject



2
3
4
# File 'lib/RubyExt/string.rb', line 2

def to_reader
	self.to_sym
end

#to_writerObject



6
7
8
# File 'lib/RubyExt/string.rb', line 6

def to_writer
	"#{self}=".to_sym
end