class Alda::GenerationError

This error is raised when one tries to run commands that are not available for the generation of Alda specified by Alda::generation.

Alda.v1!
Alda.import # (GenerationError)

Attributes

fine_generations[R]

The generations that could have been set to avoid the error. An Array.

generation[R]

The actual generation that was set by Alda::generation when the error occurs.

Public Class Methods

assert_generation(fine_generations) click to toggle source

Raises an Alda::GenerationError if the current generation is not in fine_generations.

# File lib/alda-rb/error.rb, line 117
def self.assert_generation fine_generations
  raise new fine_generations unless fine_generations.include? Alda.generation
end
new(fine_generations) → Alda::GenerationError click to toggle source

Creates a Alda::GenerationError object.

Calls superclass method
# File lib/alda-rb/error.rb, line 109
def initialize fine_generations
  super "bad Alda generation for this action; good ones are #{fine_generations}"
  @generation = Alda.generation
  @fine_generations = fine_generations
end