Module: Musa::Datasets::E
Overview
Base module for musical events.
E (Event) is the base module for all dataset types representing musical events. It provides validation interface and defines the concept of "natural keys" - keys that are inherent to the dataset type.
Natural Keys
Each dataset type defines which keys are "natural" to it (i.e., semantically meaningful for that type). Keys not in NaturalKeys are considered modifiers or extensions.
Validation
Events can be validated to ensure they contain required keys and valid values. Subclasses should override #valid? to implement type-specific validation.
Constant Summary collapse
- NaturalKeys =
Natural keys for base events (empty).
[].freeze
Instance Method Summary collapse
-
#valid? ⇒ Boolean
Checks if event is valid.
-
#validate! ⇒ void
Validates event, raising if invalid.
Instance Method Details
#valid? ⇒ Boolean
Checks if event is valid.
Base implementation always returns true. Subclasses should override to implement specific validation logic.
44 45 46 |
# File 'lib/musa-dsl/datasets/e.rb', line 44 def valid? true end |
#validate! ⇒ void
This method returns an undefined value.
Validates event, raising if invalid.
55 56 57 |
# File 'lib/musa-dsl/datasets/e.rb', line 55 def validate! raise RuntimeError, "Invalid dataset #{self}" unless valid? end |