Class: ABI::Uint
Overview
class Int
Instance Attribute Summary collapse
-
#bits ⇒ Object
readonly
Returns the value of attribute bits.
Instance Method Summary collapse
- #==(another_type) ⇒ Object
- #format ⇒ Object
-
#initialize(bits = 256) ⇒ Uint
constructor
A new instance of Uint.
-
#size ⇒ Object
note: always uses 32 bytes (with padding).
Methods inherited from Type
Constructor Details
#initialize(bits = 256) ⇒ Uint
Returns a new instance of Uint.
78 79 80 |
# File 'lib/abicoder/types.rb', line 78 def initialize( bits=256 ) @bits = bits # in bits (8,16,...256) end |
Instance Attribute Details
#bits ⇒ Object (readonly)
Returns the value of attribute bits.
77 78 79 |
# File 'lib/abicoder/types.rb', line 77 def bits @bits end |
Instance Method Details
#==(another_type) ⇒ Object
83 84 85 |
# File 'lib/abicoder/types.rb', line 83 def ==(another_type) another_type.kind_of?( Uint ) && @bits == another_type.bits end |
#format ⇒ Object
82 |
# File 'lib/abicoder/types.rb', line 82 def format() "uint#{@bits}"; end |
#size ⇒ Object
note: always uses 32 bytes (with padding)
81 |
# File 'lib/abicoder/types.rb', line 81 def size() 32; end |