class PM::CodeChunk

A CodeChunk holds a block of code (lambda, block, proc) and the text that created it as read in from a PatchMaster file.

Attributes

block[RW]
text[RW]

Public Class Methods

new(block, text=nil) click to toggle source
# File lib/patchmaster/code_chunk.rb, line 9
def initialize(block, text=nil)
  @block, @text = block, text
end

Public Instance Methods

run(*args) click to toggle source
# File lib/patchmaster/code_chunk.rb, line 13
def run(*args)
  block.call(*args)
end
to_s() click to toggle source
# File lib/patchmaster/code_chunk.rb, line 17
def to_s
  "#<PM::CodeChunk block=#{block.inspect}, text=#{text.inspect}>"
end