Class: AbiCoderRb::FixedArray
Overview
class Array
Instance Attribute Summary collapse
-
#dim ⇒ Object
readonly
Returns the value of attribute dim.
-
#subtype ⇒ Object
readonly
Returns the value of attribute subtype.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #format ⇒ Object
-
#initialize(subtype, dim) ⇒ FixedArray
constructor
A new instance of FixedArray.
- #size ⇒ Object
Methods inherited from Type
Constructor Details
#initialize(subtype, dim) ⇒ FixedArray
Returns a new instance of FixedArray.
184 185 186 187 |
# File 'lib/abi_coder_rb/types.rb', line 184 def initialize(subtype, dim) @subtype = subtype @dim = dim end |
Instance Attribute Details
#dim ⇒ Object (readonly)
Returns the value of attribute dim.
182 183 184 |
# File 'lib/abi_coder_rb/types.rb', line 182 def dim @dim end |
#subtype ⇒ Object (readonly)
Returns the value of attribute subtype.
182 183 184 |
# File 'lib/abi_coder_rb/types.rb', line 182 def subtype @subtype end |
Instance Method Details
#==(other) ⇒ Object
197 198 199 200 201 |
# File 'lib/abi_coder_rb/types.rb', line 197 def ==(other) other.is_a?(FixedArray) && @dim == other.dim && @subtype == other.subtype end |
#format ⇒ Object
193 194 195 |
# File 'lib/abi_coder_rb/types.rb', line 193 def format "#{@subtype.format}[#{@dim}]" end |
#size ⇒ Object
189 190 191 |
# File 'lib/abi_coder_rb/types.rb', line 189 def size @subtype.dynamic? ? nil : @dim * subtype.size end |