Class: EideticPDF::PropertyStack
- Inherits:
-
Object
- Object
- EideticPDF::PropertyStack
- Defined in:
- lib/epdfs.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(obj, prop, &block) ⇒ PropertyStack
constructor
A new instance of PropertyStack.
- #pop ⇒ Object
- #push(value) ⇒ Object
Constructor Details
#initialize(obj, prop, &block) ⇒ PropertyStack
Returns a new instance of PropertyStack.
43 44 45 46 |
# File 'lib/epdfs.rb', line 43 def initialize(obj, prop, &block) @obj, @prop, @condition = obj, prop, block @stack = [] end |
Instance Method Details
#pop ⇒ Object
53 54 55 56 |
# File 'lib/epdfs.rb', line 53 def pop value = @stack.pop @obj.send(@prop, value) if @condition.call(value) end |
#push(value) ⇒ Object
48 49 50 51 |
# File 'lib/epdfs.rb', line 48 def push(value) @stack.push @obj.send(@prop) @obj.send(@prop, value) if @condition.call(value) end |