Class: Tree
- Inherits:
-
Object
- Object
- Tree
- Includes:
- ManipulateNode
- Defined in:
- public/app/models/tree.rb
Instance Attribute Summary collapse
-
#breadcrumb ⇒ Object
readonly
Returns the value of attribute breadcrumb.
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#json ⇒ Object
readonly
Returns the value of attribute json.
Instance Method Summary collapse
-
#[](k) ⇒ Object
-
#dig(k) ⇒ Object
-
#initialize(tree_json) ⇒ Tree
constructor
A new instance of Tree.
Methods included from ManipulateNode
#inheritance, #process_mixed_content, #strip_mixed_content
Constructor Details
#initialize(tree_json) ⇒ Tree
Returns a new instance of Tree.
6 7 8 9 10 |
# File 'public/app/models/tree.rb', line 6 def initialize(tree_json) @json = tree_json = end |
Instance Attribute Details
#breadcrumb ⇒ Object (readonly)
Returns the value of attribute breadcrumb
4 5 6 |
# File 'public/app/models/tree.rb', line 4 def end |
#children ⇒ Object (readonly)
Returns the value of attribute children
4 5 6 |
# File 'public/app/models/tree.rb', line 4 def children @children end |
#json ⇒ Object (readonly)
Returns the value of attribute json
4 5 6 |
# File 'public/app/models/tree.rb', line 4 def json @json end |
Instance Method Details
#[](k) ⇒ Object
12 13 14 |
# File 'public/app/models/tree.rb', line 12 def [](k) @json[k] end |
#dig(k) ⇒ Object
16 17 18 |
# File 'public/app/models/tree.rb', line 16 def dig(k) @json.dig(k) end |