Class: OrgMode::Node
- Inherits:
-
Object
- Object
- OrgMode::Node
- Defined in:
- lib/org_mode.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#content ⇒ Object
Returns the value of attribute content.
-
#date ⇒ Object
Returns the value of attribute date.
-
#date_end_time ⇒ Object
Returns the value of attribute date_end_time.
-
#date_start_time ⇒ Object
Returns the value of attribute date_start_time.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#stars ⇒ Object
Returns the value of attribute stars.
-
#title ⇒ Object
Returns the value of attribute title.
-
#todo_state ⇒ Object
Returns the value of attribute todo_state.
Instance Method Summary collapse
- #appointment? ⇒ Boolean
- #done? ⇒ Boolean
- #indent ⇒ Object
-
#initialize ⇒ Node
constructor
A new instance of Node.
- #open? ⇒ Boolean
- #root_node? ⇒ Boolean
- #scheduled? ⇒ Boolean
Constructor Details
#initialize ⇒ Node
Returns a new instance of Node.
20 21 22 23 |
# File 'lib/org_mode.rb', line 20 def initialize @parent = nil @children = [] end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
18 19 20 |
# File 'lib/org_mode.rb', line 18 def children @children end |
#content ⇒ Object
Returns the value of attribute content.
17 18 19 |
# File 'lib/org_mode.rb', line 17 def content @content end |
#date ⇒ Object
Returns the value of attribute date.
17 18 19 |
# File 'lib/org_mode.rb', line 17 def date @date end |
#date_end_time ⇒ Object
Returns the value of attribute date_end_time.
17 18 19 |
# File 'lib/org_mode.rb', line 17 def date_end_time @date_end_time end |
#date_start_time ⇒ Object
Returns the value of attribute date_start_time.
17 18 19 |
# File 'lib/org_mode.rb', line 17 def date_start_time @date_start_time end |
#parent ⇒ Object
Returns the value of attribute parent.
18 19 20 |
# File 'lib/org_mode.rb', line 18 def parent @parent end |
#stars ⇒ Object
Returns the value of attribute stars.
17 18 19 |
# File 'lib/org_mode.rb', line 17 def stars @stars end |
#title ⇒ Object
Returns the value of attribute title.
17 18 19 |
# File 'lib/org_mode.rb', line 17 def title @title end |
#todo_state ⇒ Object
Returns the value of attribute todo_state.
17 18 19 |
# File 'lib/org_mode.rb', line 17 def todo_state @todo_state end |
Instance Method Details
#appointment? ⇒ Boolean
37 38 39 |
# File 'lib/org_mode.rb', line 37 def appointment? !!( date_start_time || date_end_time ) end |
#done? ⇒ Boolean
45 46 47 |
# File 'lib/org_mode.rb', line 45 def done? todo_state == 'DONE' end |
#indent ⇒ Object
25 26 27 |
# File 'lib/org_mode.rb', line 25 def indent stars + 1 end |
#open? ⇒ Boolean
41 42 43 |
# File 'lib/org_mode.rb', line 41 def open? not done? end |
#root_node? ⇒ Boolean
29 30 31 |
# File 'lib/org_mode.rb', line 29 def root_node? stars == 1 end |
#scheduled? ⇒ Boolean
33 34 35 |
# File 'lib/org_mode.rb', line 33 def scheduled? !date.nil? end |