Class: Wave::Document
- Inherits:
-
Object
- Object
- Wave::Document
- Defined in:
- lib/wave/document.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#blip ⇒ Object
readonly
Returns the value of attribute blip.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(type, options = {}) ⇒ Document
constructor
A new instance of Document.
- #items ⇒ Object
- #wave ⇒ Object
- #wavelet ⇒ Object
Constructor Details
#initialize(type, options = {}) ⇒ Document
Returns a new instance of Document.
15 16 17 18 19 20 21 |
# File 'lib/wave/document.rb', line 15 def initialize(type, = {}) @blip = .delete(:blip) @options = @annotations = [] raise Wave::WaveError, "Document has no blip" unless blip blip.document = self end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
13 14 15 |
# File 'lib/wave/document.rb', line 13 def annotations @annotations end |
#blip ⇒ Object (readonly)
Returns the value of attribute blip.
13 14 15 |
# File 'lib/wave/document.rb', line 13 def blip @blip end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
13 14 15 |
# File 'lib/wave/document.rb', line 13 def source @source end |
Instance Method Details
#items ⇒ Object
23 24 25 |
# File 'lib/wave/document.rb', line 23 def items source.to_s.scan(/<.*?>|./).flatten end |
#wave ⇒ Object
35 36 37 |
# File 'lib/wave/document.rb', line 35 def wave wavelet.wave end |
#wavelet ⇒ Object
31 32 33 |
# File 'lib/wave/document.rb', line 31 def wavelet blip.wavelet end |