Class: AbiCoderRb::FixedBytes

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(length) ⇒ FixedBytes

Returns a new instance of FixedBytes.



47
48
49
# File 'lib/abi_coder_rb/type/types.rb', line 47

def initialize(length)
  @length = length
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



45
46
47
# File 'lib/abi_coder_rb/type/types.rb', line 45

def length
  @length
end

Instance Method Details

#==(other) ⇒ Object



59
60
61
# File 'lib/abi_coder_rb/type/types.rb', line 59

def ==(other)
  other.is_a?(FixedBytes) && @length == other.length
end

#formatObject



55
56
57
# File 'lib/abi_coder_rb/type/types.rb', line 55

def format
  "bytes#{@length}"
end

#sizeObject



51
52
53
# File 'lib/abi_coder_rb/type/types.rb', line 51

def size
  32
end