Class: Clef::Notation::Articulation

Inherits:
Object
  • Object
show all
Defined in:
lib/clef/notation/articulation.rb

Constant Summary collapse

TYPES =
%i[staccato tenuto accent marcato fermata].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Articulation

Returns a new instance of Articulation.

Parameters:

  • type (Symbol)

Raises:

  • (ArgumentError)


11
12
13
14
15
# File 'lib/clef/notation/articulation.rb', line 11

def initialize(type)
  raise ArgumentError, "unsupported articulation type" unless TYPES.include?(type)

  @type = type
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/clef/notation/articulation.rb', line 8

def type
  @type
end