Class: Wizport::Pdf::Element

Inherits:
Object
  • Object
show all
Includes:
Visitable
Defined in:
lib/wizport/document/pdf/element.rb

Direct Known Subclasses

Catalog, Document, Page, Pages

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Visitable

#accept

Constructor Details

#initialize(id = nil, ver = 0, &block) ⇒ Element

Returns a new instance of Element.



11
12
13
14
15
16
17
# File 'lib/wizport/document/pdf/element.rb', line 11

def initialize(id = nil,ver = 0, &block)
  @id = id
  @ver = ver
  @dicts = {}
  @streams = {}
  block.arity<1 ? self.instance_eval(&block) : block.call(self) if block_given?
end

Instance Attribute Details

#dictsObject (readonly)

Returns the value of attribute dicts.



10
11
12
# File 'lib/wizport/document/pdf/element.rb', line 10

def dicts
  @dicts
end

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/wizport/document/pdf/element.rb', line 10

def id
  @id
end

#verObject (readonly)

Returns the value of attribute ver.



10
11
12
# File 'lib/wizport/document/pdf/element.rb', line 10

def ver
  @ver
end

Instance Method Details

#dict(k, v) ⇒ Object



27
28
29
# File 'lib/wizport/document/pdf/element.rb', line 27

def dict(k, v)
  @dicts[k] = v
end

#parentObject



23
24
25
# File 'lib/wizport/document/pdf/element.rb', line 23

def parent

end

#stream(k, v) ⇒ Object



31
32
33
# File 'lib/wizport/document/pdf/element.rb', line 31

def stream(k, v)
  @streams[k] = v
end

#to_sObject



35
36
37
# File 'lib/wizport/document/pdf/element.rb', line 35

def to_s
  "#{id} #{ver} R"
end

#typeObject



19
20
21
# File 'lib/wizport/document/pdf/element.rb', line 19

def type

end