Class: AbiCoderRb::Tuple
Instance Attribute Summary collapse
-
#inner_types ⇒ Object
readonly
Returns the value of attribute inner_types.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #format ⇒ Object
-
#initialize(inner_types) ⇒ Tuple
constructor
A new instance of Tuple.
- #size ⇒ Object
Methods inherited from Type
Constructor Details
#initialize(inner_types) ⇒ Tuple
Returns a new instance of Tuple.
176 177 178 |
# File 'lib/abi_coder_rb/type/types.rb', line 176 def initialize(inner_types) @inner_types = inner_types end |
Instance Attribute Details
#inner_types ⇒ Object (readonly)
Returns the value of attribute inner_types.
174 175 176 |
# File 'lib/abi_coder_rb/type/types.rb', line 174 def inner_types @inner_types end |
Instance Method Details
#==(other) ⇒ Object
195 196 197 |
# File 'lib/abi_coder_rb/type/types.rb', line 195 def ==(other) other.is_a?(Tuple) && @inner_types == other.inner_types end |
#format ⇒ Object
191 192 193 |
# File 'lib/abi_coder_rb/type/types.rb', line 191 def format "(#{@inner_types.map(&:format).join(",")})" end |
#size ⇒ Object
180 181 182 183 184 185 186 187 188 189 |
# File 'lib/abi_coder_rb/type/types.rb', line 180 def size s = 0 has_dynamic = false @inner_types.each do |type| ts = type.size has_dynamic ||= ts.nil? s += ts unless ts.nil? end has_dynamic ? nil : s end |