Class: Pdfrb::Arlington::Predicate::Context
- Inherits:
-
Object
- Object
- Pdfrb::Arlington::Predicate::Context
- Defined in:
- lib/pdfrb/arlington/predicate/context.rb
Overview
Runtime context for predicate evaluation. Carries the current
object, the document version, the byte size of the source
file, and references to the parent and trailer dictionaries
for path expressions (parent::Foo, trailer::Catalog).
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#file_size ⇒ Object
readonly
Returns the value of attribute file_size.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#trailer ⇒ Object
readonly
Returns the value of attribute trailer.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(current:, version:, file_size: 0, parent: nil, trailer: nil) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(current:, version:, file_size: 0, parent: nil, trailer: nil) ⇒ Context
Returns a new instance of Context.
13 14 15 16 17 18 19 20 |
# File 'lib/pdfrb/arlington/predicate/context.rb', line 13 def initialize(current:, version:, file_size: 0, parent: nil, trailer: nil) @current = current @version = version @file_size = file_size.to_i @parent = parent @trailer = trailer freeze end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
11 12 13 |
# File 'lib/pdfrb/arlington/predicate/context.rb', line 11 def current @current end |
#file_size ⇒ Object (readonly)
Returns the value of attribute file_size.
11 12 13 |
# File 'lib/pdfrb/arlington/predicate/context.rb', line 11 def file_size @file_size end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
11 12 13 |
# File 'lib/pdfrb/arlington/predicate/context.rb', line 11 def parent @parent end |
#trailer ⇒ Object (readonly)
Returns the value of attribute trailer.
11 12 13 |
# File 'lib/pdfrb/arlington/predicate/context.rb', line 11 def trailer @trailer end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
11 12 13 |
# File 'lib/pdfrb/arlington/predicate/context.rb', line 11 def version @version end |