Class: Bkmrq::BookmarkDir
- Inherits:
-
Object
- Object
- Bkmrq::BookmarkDir
- Defined in:
- lib/bkmrq/bookmark.rb
Overview
Bookmark Directory
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #add_child(child) ⇒ Object
- #children? ⇒ Boolean
-
#initialize(name) ⇒ BookmarkDir
constructor
A new instance of BookmarkDir.
Constructor Details
#initialize(name) ⇒ BookmarkDir
Returns a new instance of BookmarkDir.
22 23 24 25 |
# File 'lib/bkmrq/bookmark.rb', line 22 def initialize(name) @name = name @children = Set[] end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
20 21 22 |
# File 'lib/bkmrq/bookmark.rb', line 20 def children @children end |
#name ⇒ Object
Returns the value of attribute name.
20 21 22 |
# File 'lib/bkmrq/bookmark.rb', line 20 def name @name end |
Instance Method Details
#add_child(child) ⇒ Object
27 28 29 |
# File 'lib/bkmrq/bookmark.rb', line 27 def add_child(child) @children << child end |
#children? ⇒ Boolean
31 32 33 |
# File 'lib/bkmrq/bookmark.rb', line 31 def children? @children.any? end |