Class: AbiCoderRb::Tuple
Overview
class FixedArray
Instance Attribute Summary collapse
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #format ⇒ Object
-
#initialize(types) ⇒ Tuple
constructor
A new instance of Tuple.
- #size ⇒ Object
Methods inherited from Type
Constructor Details
#initialize(types) ⇒ Tuple
Returns a new instance of Tuple.
207 208 209 |
# File 'lib/abi_coder_rb/types.rb', line 207 def initialize(types) @types = types end |
Instance Attribute Details
#types ⇒ Object (readonly)
Returns the value of attribute types.
205 206 207 |
# File 'lib/abi_coder_rb/types.rb', line 205 def types @types end |
Instance Method Details
#==(other) ⇒ Object
233 234 235 |
# File 'lib/abi_coder_rb/types.rb', line 233 def ==(other) other.is_a?(Tuple) && @types == other.types end |
#format ⇒ Object
229 230 231 |
# File 'lib/abi_coder_rb/types.rb', line 229 def format "(#{@types.map { |t| t.format }.join(",")})" ## rebuild minimal string end |
#size ⇒ Object
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/abi_coder_rb/types.rb', line 211 def size s = 0 has_dynamic = false @types.each do |type| ts = type.size if ts.nil? # can not return nil here? if wasm has_dynamic = true else s += ts end end return if has_dynamic s end |