Class: ColonelKurtz::Block
- Inherits:
-
Object
- Object
- ColonelKurtz::Block
- Defined in:
- lib/colonel_kurtz/block.rb,
lib/colonel_kurtz/block/data.rb,
lib/colonel_kurtz/block/type.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #children ⇒ Object
- #content ⇒ Object
-
#initialize(data) ⇒ Block
constructor
A new instance of Block.
- #type ⇒ Object
Constructor Details
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
21 22 23 |
# File 'lib/colonel_kurtz/block.rb', line 21 def parent @parent end |
Instance Method Details
#children ⇒ Object
39 40 41 |
# File 'lib/colonel_kurtz/block.rb', line 39 def children @children ||= blocks.map{ |data| Block.new(data.merge("parent" => self)) } end |
#content ⇒ Object
31 32 33 |
# File 'lib/colonel_kurtz/block.rb', line 31 def content @content ||= data.fetch("content", {}) end |