Class: ABI::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
- #==(another_type) ⇒ 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.
115 116 117 118 |
# File 'lib/abicoder/types.rb', line 115 def initialize( subtype, dim ) @subtype = subtype @dim = dim end |
Instance Attribute Details
#dim ⇒ Object (readonly)
Returns the value of attribute dim.
114 115 116 |
# File 'lib/abicoder/types.rb', line 114 def dim @dim end |
#subtype ⇒ Object (readonly)
Returns the value of attribute subtype.
113 114 115 |
# File 'lib/abicoder/types.rb', line 113 def subtype @subtype end |
Instance Method Details
#==(another_type) ⇒ Object
124 125 126 127 128 |
# File 'lib/abicoder/types.rb', line 124 def ==(another_type) another_type.kind_of?( FixedArray ) && @dim == another_type.dim && @subtype == another_type.subtype end |
#format ⇒ Object
123 |
# File 'lib/abicoder/types.rb', line 123 def format() "#{@subtype.format}[#{@dim}]"; end |
#size ⇒ Object
120 121 122 |
# File 'lib/abicoder/types.rb', line 120 def size @subtype.dynamic? ? nil : @dim * subtype.size end |