Class: Sergovia::Note
- Inherits:
-
Object
- Object
- Sergovia::Note
- Defined in:
- lib/sergovia/note.rb
Instance Attribute Summary collapse
-
#fret ⇒ Object
readonly
Returns the value of attribute fret.
-
#pitch ⇒ Object
readonly
Returns the value of attribute pitch.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(fret:, string:, pitch:) ⇒ Note
constructor
A new instance of Note.
Constructor Details
#initialize(fret:, string:, pitch:) ⇒ Note
Returns a new instance of Note.
5 6 7 8 9 |
# File 'lib/sergovia/note.rb', line 5 def initialize(fret:, string:, pitch:) @fret = fret @string = string @pitch = pitch end |
Instance Attribute Details
#fret ⇒ Object (readonly)
Returns the value of attribute fret.
3 4 5 |
# File 'lib/sergovia/note.rb', line 3 def fret @fret end |
#pitch ⇒ Object (readonly)
Returns the value of attribute pitch.
3 4 5 |
# File 'lib/sergovia/note.rb', line 3 def pitch @pitch end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
3 4 5 |
# File 'lib/sergovia/note.rb', line 3 def string @string end |
Instance Method Details
#==(other) ⇒ Object
11 12 13 |
# File 'lib/sergovia/note.rb', line 11 def ==(other) self.fret == other.fret && self.string == other.string && self.pitch == other.pitch end |