Class: EideticPDF::ColorStack
- Inherits:
-
Object
- Object
- EideticPDF::ColorStack
- Defined in:
- lib/epdfs.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(obj, prop) ⇒ ColorStack
constructor
A new instance of ColorStack.
- #pop ⇒ Object
- #push(color) ⇒ Object
Constructor Details
#initialize(obj, prop) ⇒ ColorStack
Returns a new instance of ColorStack.
60 61 62 63 |
# File 'lib/epdfs.rb', line 60 def initialize(obj, prop) @obj, @prop = obj, prop @stack = [] end |
Instance Method Details
#pop ⇒ Object
70 71 72 73 |
# File 'lib/epdfs.rb', line 70 def pop color = @stack.pop @obj.send(@prop, color) if color.respond_to?(:to_int) or color.respond_to?(:to_str) end |
#push(color) ⇒ Object
65 66 67 68 |
# File 'lib/epdfs.rb', line 65 def push(color) @stack.push @obj.send(@prop) @obj.send(@prop, color) if color.respond_to?(:to_int) or color.respond_to?(:to_str) end |