Class: AbiCoderRb::FixedArray
- Defined in:
- lib/abi_coder_rb/type/types.rb
Instance Attribute Summary collapse
-
#inner_type ⇒ Object
readonly
Returns the value of attribute inner_type.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #format ⇒ Object
-
#initialize(inner_type, length) ⇒ FixedArray
constructor
A new instance of FixedArray.
- #size ⇒ Object
Methods inherited from Type
Constructor Details
#initialize(inner_type, length) ⇒ FixedArray
Returns a new instance of FixedArray.
155 156 157 158 |
# File 'lib/abi_coder_rb/type/types.rb', line 155 def initialize(inner_type, length) @inner_type = inner_type @length = length end |
Instance Attribute Details
#inner_type ⇒ Object (readonly)
Returns the value of attribute inner_type.
153 154 155 |
# File 'lib/abi_coder_rb/type/types.rb', line 153 def inner_type @inner_type end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
153 154 155 |
# File 'lib/abi_coder_rb/type/types.rb', line 153 def length @length end |
Instance Method Details
#==(other) ⇒ Object
168 169 170 |
# File 'lib/abi_coder_rb/type/types.rb', line 168 def ==(other) other.is_a?(FixedArray) && @length == other.length && @inner_type == other.inner_type end |
#format ⇒ Object
164 165 166 |
# File 'lib/abi_coder_rb/type/types.rb', line 164 def format "#{@inner_type.format}[#{@length}]" end |
#size ⇒ Object
160 161 162 |
# File 'lib/abi_coder_rb/type/types.rb', line 160 def size @inner_type.dynamic? ? nil : @length * inner_type.size end |