module Plock

Constants

VERSION

Attributes

output_format[W]

Public Class Methods

format_with(inspect_method, block_source, block_result) click to toggle source
# File lib/plock.rb, line 30
def format_with inspect_method, block_source, block_result
  result = self.output_format.dup
  result.sub! self::Format::PERCENT_B, block_source
  result.sub! self::Format::PERCENT_R, block_result.__send__( inspect_method )
  return result
end
inspect_block( attached = :inspect_block, &block ) click to toggle source
# File lib/plock.rb, line 19
def inspect_block( attached = :inspect_block, &block )
  result = block.call
  [ block.to_source( attached_to: attached, strip_enclosure: true ), result ]
end
output_format() click to toggle source
# File lib/plock.rb, line 15
def output_format
  @output_format ||= self::Format::DEFAULT_FORMAT
end
print_block_with(inspect_method, attached, &block) click to toggle source