Class: NA::Project
Overview
Represents a project section in a todo file, with indentation and line tracking.
Instance Attribute Summary collapse
-
#indent ⇒ Object
Returns the value of attribute indent.
-
#last_line ⇒ Object
Returns the value of attribute last_line.
-
#line ⇒ Object
Returns the value of attribute line.
-
#project ⇒ Object
Returns the value of attribute project.
Instance Method Summary collapse
-
#initialize(project, indent = 0, line = 0, last_line = 0) ⇒ void
constructor
Initialize a Project object.
-
#inspect ⇒ String
Inspect the project object.
-
#to_s ⇒ String
String representation of the project.
Methods inherited from Hash
#deep_freeze, #deep_freeze!, #deep_merge, #deep_thaw, #deep_thaw!, #symbolize_keys
Constructor Details
#initialize(project, indent = 0, line = 0, last_line = 0) ⇒ void
Initialize a Project object
20 21 22 23 24 25 26 |
# File 'lib/na/project.rb', line 20 def initialize(project, indent = 0, line = 0, last_line = 0) super() @project = project @indent = indent @line = line @last_line = last_line end |
Instance Attribute Details
#indent ⇒ Object
Returns the value of attribute indent.
9 10 11 |
# File 'lib/na/project.rb', line 9 def indent @indent end |
#last_line ⇒ Object
Returns the value of attribute last_line.
9 10 11 |
# File 'lib/na/project.rb', line 9 def last_line @last_line end |
#line ⇒ Object
Returns the value of attribute line.
9 10 11 |
# File 'lib/na/project.rb', line 9 def line @line end |
#project ⇒ Object
Returns the value of attribute project.
9 10 11 |
# File 'lib/na/project.rb', line 9 def project @project end |
Instance Method Details
#inspect ⇒ String
Inspect the project object
40 41 42 43 44 45 46 47 |
# File 'lib/na/project.rb', line 40 def inspect [ "@project: #{@project}", "@indent: #{@indent}", "@line: #{@line}", "@last_line: #{@last_line}" ].join(' ') end |
#to_s ⇒ String
String representation of the project
33 34 35 |
# File 'lib/na/project.rb', line 33 def to_s { project: @project, indent: @indent, line: @line, last_line: @last_line }.to_s end |