Class: ABI::Tuple
Overview
class FixedArray
Instance Attribute Summary collapse
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
- #==(another_type) ⇒ 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.
134 135 136 |
# File 'lib/abicoder/types.rb', line 134 def initialize( types ) @types = types end |
Instance Attribute Details
#types ⇒ Object (readonly)
Returns the value of attribute types.
132 133 134 |
# File 'lib/abicoder/types.rb', line 132 def types @types end |
Instance Method Details
#==(another_type) ⇒ Object
150 151 152 |
# File 'lib/abicoder/types.rb', line 150 def ==(another_type) another_type.kind_of?( Tuple ) && @types == another_type.types end |
#format ⇒ Object
147 148 149 |
# File 'lib/abicoder/types.rb', line 147 def format "(#{@types.map {|t| t.format }.join(',')})" ## rebuild minimal string end |
#size ⇒ Object
138 139 140 141 142 143 144 145 146 |
# File 'lib/abicoder/types.rb', line 138 def size s = 0 @types.each do |type| ts = type.size return nil if ts.nil? s += ts end s end |