Class: Juicy::Mode

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rotateObject (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_sObject



22
23
24
# File 'lib/juicy/mode.rb', line 22

def to_s
  "#{@type}"
end