Class: Clef::Layout::Item
- Inherits:
-
Object
- Object
- Clef::Layout::Item
- Defined in:
- lib/clef/layout/item.rb
Instance Attribute Summary collapse
-
#measure_number ⇒ Object
readonly
Returns the value of attribute measure_number.
-
#moment ⇒ Object
readonly
Returns the value of attribute moment.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#staff_id ⇒ Object
readonly
Returns the value of attribute staff_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, moment:, staff_id: nil, measure_number: nil, payload: {}) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(type:, moment:, staff_id: nil, measure_number: nil, payload: {}) ⇒ Item
Returns a new instance of Item.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/clef/layout/item.rb', line 13 def initialize(type:, moment:, staff_id: nil, measure_number: nil, payload: {}) raise ArgumentError, "type must be a Symbol" unless type.is_a?(Symbol) raise ArgumentError, "moment must be a Clef::Ir::Moment" unless moment.is_a?(Clef::Ir::Moment) raise ArgumentError, "payload must be a Hash" unless payload.is_a?(Hash) @type = type @moment = moment @staff_id = staff_id @measure_number = measure_number @payload = payload.dup end |
Instance Attribute Details
#measure_number ⇒ Object (readonly)
Returns the value of attribute measure_number.
6 7 8 |
# File 'lib/clef/layout/item.rb', line 6 def measure_number @measure_number end |
#moment ⇒ Object (readonly)
Returns the value of attribute moment.
6 7 8 |
# File 'lib/clef/layout/item.rb', line 6 def moment @moment end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
6 7 8 |
# File 'lib/clef/layout/item.rb', line 6 def payload @payload end |
#staff_id ⇒ Object (readonly)
Returns the value of attribute staff_id.
6 7 8 |
# File 'lib/clef/layout/item.rb', line 6 def staff_id @staff_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/clef/layout/item.rb', line 6 def type @type end |