Class: Stagecraft::IndexAttribute
- Inherits:
-
Object
- Object
- Stagecraft::IndexAttribute
- Defined in:
- lib/stagecraft/core/attribute.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#data ⇒ Object
Returns the value of attribute data.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(data:, format:, &on_change) ⇒ IndexAttribute
constructor
A new instance of IndexAttribute.
Constructor Details
#initialize(data:, format:, &on_change) ⇒ IndexAttribute
Returns a new instance of IndexAttribute.
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/stagecraft/core/attribute.rb', line 67 def initialize(data:, format:, &on_change) @format = format.to_sym raise ArgumentError, "index format must be :uint16 or :uint32" unless %i[uint16 uint32].include?(@format) @version = 0 @on_change = on_change @initialized = false self.data = data @initialized = true end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
65 66 67 |
# File 'lib/stagecraft/core/attribute.rb', line 65 def count @count end |
#data ⇒ Object
Returns the value of attribute data.
65 66 67 |
# File 'lib/stagecraft/core/attribute.rb', line 65 def data @data end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
65 66 67 |
# File 'lib/stagecraft/core/attribute.rb', line 65 def format @format end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
65 66 67 |
# File 'lib/stagecraft/core/attribute.rb', line 65 def version @version end |