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/canvas.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/chunkable.rb,
lib/prawn/core/page.rb,
lib/prawn/core/text.rb,
lib/prawn/core/chunk.rb,
lib/prawn/font/dfont.rb,
lib/prawn/images/jpg.rb,
lib/prawn/images/png.rb,
lib/prawn/table/cell.rb,
lib/prawn/table/cells.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/cell/text.rb,
lib/prawn/core/annotations.rb,
lib/prawn/core/byte_string.rb,
lib/prawn/document_builder.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/document_builder/layout.rb,
lib/prawn/graphics/transformation.rb,
lib/prawn/text/formatted/fragment.rb,
lib/prawn/core/text/formatted/wrap.rb,
lib/prawn/document_builder/command.rb,
lib/prawn/core/text/formatted/arranger.rb,
lib/prawn/core/text/formatted/line_wrap.rb,
lib/prawn/document_builder/constructs/path_construct.rb,
lib/prawn/document_builder/modifications/path_modification.rb,
lib/prawn/document_builder/constructs/flowing_text_construct.rb,
lib/prawn/document_builder/modifications/layout_modification.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: Chunkable, Configurable, Core, Encoding, Errors, Graphics, Images, Measurements, Stamp, Text Classes: Canvas, Document, DocumentBuilder, Font, Outline, OutlineItem, OutlineRoot, Repeater, Table
Constant Summary collapse
- BASEDIR =
The base source directory for Prawn as installed on the system
File.(File.join(dir, '..', '..'))
Instance Attribute Summary collapse
-
#debug ⇒ Object
Whe set to true, Prawn will verify hash options to ensure only valid keys are used.
Instance Method Summary collapse
Instance Attribute Details
#debug ⇒ Object
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, ...]
43 44 45 |
# File 'lib/prawn/core.rb', line 43 def debug @debug end |
Instance Method Details
#verify_options(accepted, actual) ⇒ Object
:nodoc:
45 46 47 48 49 50 51 52 53 |
# File 'lib/prawn/core.rb', line 45 def (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 |