### Home Classes Methods

### In Files

- lib/prawn/document/graphics_state.rb

### Parent

Object

### Methods

- ::new
- #dash_setting

### Files

- COPYING
- GPLv2
- GPLv3
- LICENSE

### Class/Module Index

Quicksearch

- Prawn
- Prawn::Core
- Prawn::Core::Page
- Prawn::Core::Page::GraphicsState
- Prawn::Core::Reference
- Prawn::Document
- Prawn::Document::BoundingBox
- Prawn::Document::ColumnBox
- Prawn::Document::GraphicsState
- Prawn::Document::Grid
- Prawn::Document::Internals
- Prawn::Document::PageGeometry
- Prawn::Document::Security
- Prawn::Document::Snapshot
- Prawn::Encoding
- Prawn::Errors
- Prawn::Font
- Prawn::Font::AFM
- Prawn::Font::DFont
- Prawn::Font::TTF
- Prawn::GraphicState
- Prawn::GraphicStateStack
- Prawn::Graphics
- Prawn::Graphics::CapStyle
- Prawn::Graphics::Color
- Prawn::Graphics::Dash
- Prawn::Graphics::Gradient
- Prawn::Graphics::JoinStyle
- Prawn::Graphics::Transformation
- Prawn::Graphics::Transparency
- Prawn::Images
- Prawn::Images::JPG
- Prawn::Images::PNG
- Prawn::Layout
- Prawn::Measurements
- Prawn::Outline
- Prawn::Stamp
- Prawn::Table
- Prawn::Table::Cell
- Prawn::Table::Cell::InTable
- Prawn::Table::Cell::Subtable
- Prawn::Table::Cell::Text
- Prawn::Table::Cells
- Prawn::Text
- Prawn::Text::Box
- Prawn::Text::Formatted
- Prawn::Text::Formatted::Box
- Prawn::Text::Formatted::Fragment
- Prawn::Text::Formatted::Parser
- Arcfour
- Numeric

No matching classes.

# Prawn::GraphicState

### Attributes

cap_style[RW]
color_space[RW]
dash[RW]
fill_color[RW]
join_style[RW]
line_width[RW]
stroke_color[RW]

### Public Class Methods

new(previous_state = nil) click to toggle source

    # File lib/prawn/document/graphics_state.rb, line 46
    def initialize(previous_state = nil)
      @color_space = previous_state ? previous_state.color_space.dup : {}
      @fill_color = previous_state ? previous_state.fill_color : "000000"
      @stroke_color = previous_state ? previous_state.stroke_color : "000000"
      @dash = previous_state ? previous_state.dash : { :dash => nil, :space => nil, :phase => 0 }
      @cap_style = previous_state ? previous_state.cap_style : :butt
      @join_style = previous_state ? previous_state.join_style : :miter
      @line_width = previous_state ? previous_state.line_width : 1
    end

### Public Instance Methods

dash_setting() click to toggle source

    # File lib/prawn/document/graphics_state.rb, line 56
    def dash_setting
      "[#{@dash[:dash]} #{@dash[:space]}] #{@dash[:phase]} d"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.