Class: GuitarProParser::Beat

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBeat

Returns a new instance of Beat.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/guitar_pro_parser/beat.rb', line 16

def initialize
  # Initialize attributes by default values
  @dotted = false
  @mix_table = nil
  @rest = nil
  
  @duration = :eighth
  @tuplet = nil
  @chord_diagram = nil
  @text = nil
  @effects = {}
  @strings = {}

  @transpose = nil
end

Instance Attribute Details

#chord_diagramObject

Returns the value of attribute chord_diagram.



5
6
7
# File 'lib/guitar_pro_parser/beat.rb', line 5

def chord_diagram
  @chord_diagram
end

#dottedObject

Returns the value of attribute dotted.



5
6
7
# File 'lib/guitar_pro_parser/beat.rb', line 5

def dotted
  @dotted
end

#durationObject

Returns the value of attribute duration.



5
6
7
# File 'lib/guitar_pro_parser/beat.rb', line 5

def duration
  @duration
end

#effectsObject

Returns the value of attribute effects.



5
6
7
# File 'lib/guitar_pro_parser/beat.rb', line 5

def effects
  @effects
end

#mix_tableObject

Returns the value of attribute mix_table.



5
6
7
# File 'lib/guitar_pro_parser/beat.rb', line 5

def mix_table
  @mix_table
end

#restObject

Returns the value of attribute rest.



5
6
7
# File 'lib/guitar_pro_parser/beat.rb', line 5

def rest
  @rest
end

#stringsObject

Returns the value of attribute strings.



5
6
7
# File 'lib/guitar_pro_parser/beat.rb', line 5

def strings
  @strings
end

#textObject

Returns the value of attribute text.



5
6
7
# File 'lib/guitar_pro_parser/beat.rb', line 5

def text
  @text
end

#transposeObject

Returns the value of attribute transpose.



5
6
7
# File 'lib/guitar_pro_parser/beat.rb', line 5

def transpose
  @transpose
end

#tupletObject

Returns the value of attribute tuplet.



5
6
7
# File 'lib/guitar_pro_parser/beat.rb', line 5

def tuplet
  @tuplet
end

Instance Method Details

#add_effect(effect) ⇒ Object



36
37
38
# File 'lib/guitar_pro_parser/beat.rb', line 36

def add_effect(effect)
  @effects[effect] = nil
end

#has_effect?(effect) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/guitar_pro_parser/beat.rb', line 32

def has_effect?(effect)
  @effects.include?(effect)
end