Sha256: 0c6d2cf0f8f0078b4c1eaf54b41bab8b233c434d897085a50eabd98adf12d5e0

Contents?: true

Size: 325 Bytes

Versions: 1

Compression:

Stored size: 325 Bytes

Contents

String.class_eval do
	def to_reader
		self.to_sym
	end
	
	def to_writer
		"#{self}=".to_sym
	end
	
	def to_iv
		"@#{self}"
	end
	
  def interpolate binding
    binding.should! :be_a, Binding
    return gsub(/\#\{.+?\}/) do |term|
      identifier = term.slice(2 .. term.size-2)
      binding.eval identifier
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-ext-0.2.9 lib/ruby_ext/string.rb