Class: RGhost::VerticalLine
- Defined in:
- lib/rghost/vertical_line.rb
Overview
Creates vertical line starting from current row.
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :start_in=>:limit_left,:size=>:area_y, :border => RGhost::Border::DEFAULT_OPTIONS }
Class Method Summary collapse
-
.row(border = RGhost::Border::DEFAULT_OPTIONS) ⇒ Object
Draws a vertical line with size or :row_height of the document.
Instance Method Summary collapse
-
#initialize(options = RGhost::Border::DEFAULT_OPTIONS) ⇒ VerticalLine
constructor
Draws a vertical line where :start_in => y position and :size => size of line.
Methods inherited from PsObject
#<<, #call, #graphic_scope, #ps, #raw, #set, #to_s
Constructor Details
#initialize(options = RGhost::Border::DEFAULT_OPTIONS) ⇒ VerticalLine
Draws a vertical line where :start_in => y position and :size => size of line.
Example
doc=Document.new doc.vertical_line :start_in => 1, :size => 2, :border => => :red
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rghost/vertical_line.rb', line 15 def initialize(=RGhost::Border::DEFAULT_OPTIONS) super(""){} =DEFAULT_OPTIONS.dup.merge() start_in= RGhost::Units::parse([:start_in] || :limit_left) size= RGhost::Units::parse([:size]|| :area_y) g=RGhost::Graphic.new g.set RGhost::Border.new([:border]) if [:border] g.raw "#{start_in} #{size} vertical_line " set g end |
Class Method Details
.row(border = RGhost::Border::DEFAULT_OPTIONS) ⇒ Object
Draws a vertical line with size or :row_height of the document.
doc=Document.new
doc.vertical_line_row
28 29 30 31 32 33 34 |
# File 'lib/rghost/vertical_line.rb', line 28 def self.row(border=RGhost::Border::DEFAULT_OPTIONS) g=RGhost::Graphic.new g.set RGhost::Border.new(border) g.raw :vlrf g end |