Class: Wave::Blip
- Inherits:
-
Object
- Object
- Wave::Blip
- Defined in:
- lib/wave/blip.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#content ⇒ Object
Returns the value of attribute content.
-
#creator ⇒ Object
readonly
Returns the value of attribute creator.
-
#document ⇒ Object
Returns the value of attribute document.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#wavelet ⇒ Object
readonly
Returns the value of attribute wavelet.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Blip
constructor
A new instance of Blip.
- #root? ⇒ Boolean
- #wave ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Blip
Returns a new instance of Blip.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/wave/blip.rb', line 19 def initialize( = {}) if [:parent] @parent = [:parent] @parent.children << self @wavelet = @parent.wavelet end @wavelet ||= [:wavelet] raise Wave::WaveError, "Blip has no wavelet" unless @wavelet @creator = [:creator] raise Wave::WaveError, "Blip has no creator" unless @creator @content = [:content] @wavelet.blips << self @children ||= [] end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
16 17 18 |
# File 'lib/wave/blip.rb', line 16 def children @children end |
#content ⇒ Object
Returns the value of attribute content.
17 18 19 |
# File 'lib/wave/blip.rb', line 17 def content @content end |
#creator ⇒ Object (readonly)
Returns the value of attribute creator.
16 17 18 |
# File 'lib/wave/blip.rb', line 16 def creator @creator end |
#document ⇒ Object
Returns the value of attribute document.
17 18 19 |
# File 'lib/wave/blip.rb', line 17 def document @document end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
16 17 18 |
# File 'lib/wave/blip.rb', line 16 def parent @parent end |
#wavelet ⇒ Object (readonly)
Returns the value of attribute wavelet.
16 17 18 |
# File 'lib/wave/blip.rb', line 16 def wavelet @wavelet end |
Instance Method Details
#root? ⇒ Boolean
34 35 36 |
# File 'lib/wave/blip.rb', line 34 def root? self == wavelet.blips.first end |
#wave ⇒ Object
38 39 40 |
# File 'lib/wave/blip.rb', line 38 def wave wavelet.wave end |