Class: Wave::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/wave/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, options = {}) ⇒ Document

Returns a new instance of Document.

Raises:



15
16
17
18
19
20
21
# File 'lib/wave/document.rb', line 15

def initialize(type, options = {})
  @blip         = options.delete(:blip)
  @options      = options
  @annotations  = []
  raise Wave::WaveError, "Document has no blip" unless blip
  blip.document = self
end

Instance Attribute Details

#annotationsObject (readonly)

Returns the value of attribute annotations.



13
14
15
# File 'lib/wave/document.rb', line 13

def annotations
  @annotations
end

#blipObject (readonly)

Returns the value of attribute blip.



13
14
15
# File 'lib/wave/document.rb', line 13

def blip
  @blip
end

#sourceObject (readonly)

Returns the value of attribute source.



13
14
15
# File 'lib/wave/document.rb', line 13

def source
  @source
end

Instance Method Details

#itemsObject



23
24
25
# File 'lib/wave/document.rb', line 23

def items
  source.to_s.scan(/<.*?>|./).flatten
end

#waveObject



35
36
37
# File 'lib/wave/document.rb', line 35

def wave
  wavelet.wave
end

#waveletObject



31
32
33
# File 'lib/wave/document.rb', line 31

def wavelet
  blip.wavelet
end