Class: RGhost::PsObject
- Inherits:
-
Object
- Object
- RGhost::PsObject
- Defined in:
- lib/rghost/ps_object.rb
Overview
Postscript wrapper class
Direct Known Subclasses
Border, Callback, Circle, Color, Cursor, DSCEntry, Dash, Eps, Font, FontMap, Frame, Function, Graphic, Grid::Base, Grid::Header, HorizontalLine, Image, Line, LineWidth, NewPath, Paper, Point, Polygon, PsFacade, RectangleLink, Scale, ShapeContent, Show, Text, TextArea, TextIn, TextLinkIn, Units::Unit, Variable, VerticalLine, VirtualPages
Instance Method Summary collapse
-
#<<(value) ⇒ Object
Alias for set.
-
#call(name) ⇒ Object
Call operator in the stack.
-
#graphic_scope ⇒ Object
Freezes graphic state.
-
#initialize(body = "", &block) ⇒ PsObject
constructor
Creates new instance of PsObject.
-
#ps ⇒ Object
Gets postscript code.
-
#raw(*value) ⇒ Object
Pushes elements on the stack.
-
#set(value) ⇒ Object
Sets PsObject into this object.
-
#to_s ⇒ Object
Alias for ps.
Constructor Details
Instance Method Details
#<<(value) ⇒ Object
Alias for set
45 46 47 48 |
# File 'lib/rghost/ps_object.rb', line 45 def <<(value) set value end |
#call(name) ⇒ Object
Call operator in the stack
51 52 53 |
# File 'lib/rghost/ps_object.rb', line 51 def call(name) set RGhost::PsObject.new(name) end |
#graphic_scope ⇒ Object
Freezes graphic state
34 35 36 |
# File 'lib/rghost/ps_object.rb', line 34 def graphic_scope "beging #{self} endg " end |
#ps ⇒ Object
Gets postscript code.
26 27 28 |
# File 'lib/rghost/ps_object.rb', line 26 def ps @body.to_s end |
#raw(*value) ⇒ Object
Pushes elements on the stack.
30 31 32 |
# File 'lib/rghost/ps_object.rb', line 30 def raw(*value) @body << "#{value.join(' ')} " end |
#set(value) ⇒ Object
Sets PsObject into this object.
38 39 40 41 42 43 |
# File 'lib/rghost/ps_object.rb', line 38 def set(value) raise TypeError.new("can't convert #{value.class} into PsObject") unless value.is_a? RGhost::PsObject @body << "#{value.ps} " value end |
#to_s ⇒ Object
Alias for ps.
22 23 24 |
# File 'lib/rghost/ps_object.rb', line 22 def to_s ps end |