Class: AbiCoderRb::Uint

Inherits:
Type
  • Object
show all
Defined in:
lib/abi_coder_rb/type/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#dynamic?, parse

Constructor Details

#initialize(bits = 256) ⇒ Uint

Returns a new instance of Uint.



87
88
89
# File 'lib/abi_coder_rb/type/types.rb', line 87

def initialize(bits = 256)
  @bits = bits
end

Instance Attribute Details

#bitsObject (readonly)

Returns the value of attribute bits.



85
86
87
# File 'lib/abi_coder_rb/type/types.rb', line 85

def bits
  @bits
end

Instance Method Details

#==(other) ⇒ Object



99
100
101
# File 'lib/abi_coder_rb/type/types.rb', line 99

def ==(other)
  other.is_a?(Uint) && @bits == other.bits
end

#formatObject



95
96
97
# File 'lib/abi_coder_rb/type/types.rb', line 95

def format
  "uint#{@bits}"
end

#sizeObject



91
92
93
# File 'lib/abi_coder_rb/type/types.rb', line 91

def size
  32
end