Class: Note

Inherits:
Object
  • Object
show all
Defined in:
lib/note.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#filepathObject (readonly)

Returns the value of attribute filepath.



2
3
4
# File 'lib/note.rb', line 2

def filepath
  @filepath
end

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'lib/note.rb', line 2

def id
  @id
end

#lineObject (readonly)

Returns the value of attribute line.



2
3
4
# File 'lib/note.rb', line 2

def line
  @line
end

#noteObject (readonly)

Returns the value of attribute note.



2
3
4
# File 'lib/note.rb', line 2

def note
  @note
end

Instance Method Details

#to_sObject



10
11
12
13
14
# File 'lib/note.rb', line 10

def to_s
  str = ""
  str << "#{@line}".rjust(5) + ": "
  str << "#{note}"
end