Class: Sergovia::Note

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fretObject (readonly)

Returns the value of attribute fret.



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

def fret
  @fret
end

#pitchObject (readonly)

Returns the value of attribute pitch.



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

def pitch
  @pitch
end

#stringObject (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