Class: Note
- Inherits:
-
Object
- Object
- Note
- Defined in:
- lib/note.rb
Instance Attribute Summary collapse
-
#filepath ⇒ Object
readonly
Returns the value of attribute filepath.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#note ⇒ Object
readonly
Returns the value of attribute note.
Instance Method Summary collapse
-
#initialize(args) ⇒ Note
constructor
A new instance of Note.
- #to_s ⇒ Object
Constructor Details
#initialize(args) ⇒ Note
Returns a new instance of Note.
4 5 6 7 8 |
# File 'lib/note.rb', line 4 def initialize args @filepath = args[:filepath] @note = args[:note] @line = args[:line] end |
Instance Attribute Details
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
2 3 4 |
# File 'lib/note.rb', line 2 def filepath @filepath end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/note.rb', line 2 def id @id end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
2 3 4 |
# File 'lib/note.rb', line 2 def line @line end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
2 3 4 |
# File 'lib/note.rb', line 2 def note @note end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 |
# File 'lib/note.rb', line 10 def to_s str = "" str << "#{@line}".rjust(5) + ": " str << "#{note}" end |