### Home Classes Methods

### In Files

- lib/prawn/graphics/dash.rb

### Methods

- #dash
- #dash=
- #dashed?
- #undash

### Files

- COPYING
- HACKING
- LICENSE
- README

### Class/Module Index

Quicksearch

- Prawn
- Prawn::Core
- Prawn::Document
- Prawn::Document::Annotations
- Prawn::Document::BoundingBox
- Prawn::Document::ColumnBox
- Prawn::Document::Destinations
- Prawn::Document::GraphicsState
- Prawn::Document::Internals
- Prawn::Document::PageGeometry
- Prawn::Document::Snapshot
- Prawn::Encoding
- Prawn::Errors
- Prawn::Font
- Prawn::Font::AFM
- Prawn::Font::DFont
- Prawn::Font::TTF
- Prawn::Graphics
- Prawn::Graphics::CapStyle
- Prawn::Graphics::Color
- Prawn::Graphics::Dash
- Prawn::Graphics::JoinStyle
- Prawn::Graphics::Transformation
- Prawn::Graphics::Transparency
- Prawn::Images
- Prawn::Images::JPG
- Prawn::Images::PNG
- Prawn::Measurements
- Prawn::Outline
- Prawn::Stamp
- Prawn::Text
- Prawn::Text::Box
- Prawn::Text::LineWrap
- File
- Numeric

No matching classes.

# Prawn::Graphics::Dash

### Public Instance Methods

dash(length=nil, options={}) click to toggle source

Sets the dash pattern for stroked lines and curves

    length is the length of the dash. If options is not present,
    or options[:space] is nil, then length is also the length of
    the space between dashes

    options may contain :space and :phase
       :space is the space between the dashes
       :phase is where in the cycle to begin dashing. For
              example, a phase of 0 starts at the beginning of
              the dash; whereas, if the phase is equal to the
              length of the dash, then stroking will begin at
              the beginning of the space. Default is 0

    integers or floats may be used for length and the options

    dash units are in PDF points ( 1/72 in )

    # File lib/prawn/graphics/dash.rb, line 30
    def dash(length=nil, options={})
      return @dash || undash_hash if length.nil?

      @dash = { :dash  => length,
                :space => options[:space] || length,
                :phase => options[:phase] || 0 }

      write_stroke_dash
    end

Also aliased as: dash=
dash=(length=nil, options={}) click to toggle source
Alias for: dash
dashed?() click to toggle source

Returns when stroke is dashed, false otherwise

    # File lib/prawn/graphics/dash.rb, line 51
    def dashed?
      dash != undash_hash
    end

undash() click to toggle source

Stops dashing, restoring solid stroked lines and curves

    # File lib/prawn/graphics/dash.rb, line 44
    def undash
      @dash = undash_hash
      write_stroke_dash
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.