Class: AbiCoderRb::Int

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) ⇒ Int

Returns a new instance of Int.



67
68
69
# File 'lib/abi_coder_rb/type/types.rb', line 67

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

Instance Attribute Details

#bitsObject (readonly)

Returns the value of attribute bits.



65
66
67
# File 'lib/abi_coder_rb/type/types.rb', line 65

def bits
  @bits
end

Instance Method Details

#==(other) ⇒ Object



79
80
81
# File 'lib/abi_coder_rb/type/types.rb', line 79

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

#formatObject



75
76
77
# File 'lib/abi_coder_rb/type/types.rb', line 75

def format
  "int#{@bits}"
end

#sizeObject



71
72
73
# File 'lib/abi_coder_rb/type/types.rb', line 71

def size
  32
end