Module: Prawn

Extended by:
Prawn
Included in:
Prawn
Defined in:
lib/prawn.rb,
lib/prawn/core.rb,
lib/prawn/font.rb,
lib/prawn/text.rb,
lib/prawn/stamp.rb,
lib/prawn/table.rb,
lib/prawn/errors.rb,
lib/prawn/images.rb,
lib/prawn/outline.rb,
lib/prawn/document.rb,
lib/prawn/encoding.rb,
lib/prawn/font/afm.rb,
lib/prawn/font/ttf.rb,
lib/prawn/graphics.rb,
lib/prawn/repeater.rb,
lib/prawn/security.rb,
lib/prawn/text/box.rb,
lib/prawn/core/page.rb,
lib/prawn/core/text.rb,
lib/prawn/font/dfont.rb,
lib/prawn/images/jpg.rb,
lib/prawn/images/png.rb,
lib/prawn/table/cell.rb,
lib/prawn/measurements.rb,
lib/prawn/graphics/dash.rb,
lib/prawn/core/name_tree.rb,
lib/prawn/core/reference.rb,
lib/prawn/core/text/wrap.rb,
lib/prawn/graphics/color.rb,
lib/prawn/core/pdf_object.rb,
lib/prawn/table/accessors.rb,
lib/prawn/table/cell/text.rb,
lib/prawn/core/annotations.rb,
lib/prawn/core/byte_string.rb,
lib/prawn/core/destinations.rb,
lib/prawn/core/object_store.rb,
lib/prawn/document/snapshot.rb,
lib/prawn/document/internals.rb,
lib/prawn/graphics/cap_style.rb,
lib/prawn/text/formatted/box.rb,
lib/prawn/core/document_state.rb,
lib/prawn/core/literal_string.rb,
lib/prawn/core/text/line_wrap.rb,
lib/prawn/graphics/join_style.rb,
lib/prawn/table/cell/in_table.rb,
lib/prawn/table/cell/subtable.rb,
lib/prawn/document/bounding_box.rb,
lib/prawn/graphics/transparency.rb,
lib/prawn/text/formatted/parser.rb,
lib/prawn/document/page_geometry.rb,
lib/prawn/document/graphics_state.rb,
lib/prawn/graphics/transformation.rb,
lib/prawn/text/formatted/fragment.rb,
lib/prawn/core/text/formatted/wrap.rb,
lib/prawn/core/text/formatted/arranger.rb,
lib/prawn/core/text/formatted/line_wrap.rb

Overview

core/text/formatted/line_wrap.rb : Implements individual line wrapping of

formatted text

Copyright February 2010, Daniel Nelson. All Rights Reserved.

This is free software. Please see the LICENSE and COPYING files for details.

Defined Under Namespace

Modules: Configurable, Core, Encoding, Errors, Graphics, Images, Measurements, Stamp, Text Classes: Document, Font, Outline, OutlineItem, OutlineRoot, Repeater, Table

Constant Summary collapse

BASEDIR =

The base source directory for Prawn as installed on the system

File.expand_path(File.join(dir, '..', '..'))
VERSION =
"0.10.2"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#debugObject

Whe set to true, Prawn will verify hash options to ensure only valid keys are used. Off by default.

Example:

>> Prawn::Document.new(:tomato => "Juicy")
Prawn::Errors::UnknownOption: 
Detected unknown option(s): [:tomato]
Accepted options are: [:page_size, :page_layout, :left_margin, ...]


47
48
49
# File 'lib/prawn/core.rb', line 47

def debug
  @debug
end

Instance Method Details

#verify_options(accepted, actual) ⇒ Object

:nodoc:



49
50
51
52
53
54
55
56
57
# File 'lib/prawn/core.rb', line 49

def verify_options(accepted, actual) #:nodoc:
  return unless debug || $DEBUG
  unless (act=Set[*actual.keys]).subset?(acc=Set[*accepted])
    raise Prawn::Errors::UnknownOption,
      "\nDetected unknown option(s): #{(act - acc).to_a.inspect}\n" <<
      "Accepted options are: #{accepted.inspect}"
  end
  yield if block_given?
end