Class: Prune::Elements::Stream
- Defined in:
- lib/prune/elements/stream.rb
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(document) ⇒ Stream
constructor
Initialize.
-
#to_s ⇒ Object
Convert stream to String.
Methods inherited from Base
Methods included from Functions
Methods included from PObjects
Constructor Details
#initialize(document) ⇒ Stream
Initialize.
9 10 11 12 13 14 15 16 17 |
# File 'lib/prune/elements/stream.rb', line 9 def initialize(document) super(document) # Set dictionary. @content = pd(pn(:Length) => 0) # Set stream. @stream = ps # Register element to document. register end |
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
6 7 8 |
# File 'lib/prune/elements/stream.rb', line 6 def stream @stream end |
Instance Method Details
#to_s ⇒ Object
Convert stream to String.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/prune/elements/stream.rb', line 20 def to_s # Update length of the stream. @content[pn(:Length)] = @stream.length # Convert to String. out = [] out << "#{@element_id} #{@revision} obj" out << @content.to_s out << @stream.to_s out << "endobj" return out.join(LF) end |