Class: Juicy::Mode
- Inherits:
-
Object
- Object
- Juicy::Mode
- Defined in:
- lib/juicy/mode.rb
Instance Attribute Summary collapse
-
#rotate ⇒ Object
readonly
Returns the value of attribute rotate.
Instance Method Summary collapse
-
#initialize(type = :ionian) ⇒ Mode
constructor
A new instance of Mode.
- #to_s ⇒ Object
Constructor Details
#initialize(type = :ionian) ⇒ Mode
Returns a new instance of Mode.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/juicy/mode.rb', line 10 def initialize(type = :ionian) @type = type @rotate = case @type when :major 0 when :minor -2 else 0 end end |
Instance Attribute Details
#rotate ⇒ Object (readonly)
Returns the value of attribute rotate.
8 9 10 |
# File 'lib/juicy/mode.rb', line 8 def rotate @rotate end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'lib/juicy/mode.rb', line 22 def to_s "#{@type}" end |