Class: AbiCoderRb::FixedBytes
Overview
class Bytes
Instance Attribute Summary collapse
-
#length ⇒ Object
readonly
Returns the value of attribute length.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #format ⇒ Object
-
#initialize(length) ⇒ FixedBytes
constructor
A new instance of FixedBytes.
-
#size ⇒ Object
note: always uses 32 bytes (with padding).
Methods inherited from Type
Constructor Details
#initialize(length) ⇒ FixedBytes
Returns a new instance of FixedBytes.
70 71 72 |
# File 'lib/abi_coder_rb/types.rb', line 70 def initialize(length) @length = length # in bytes (1,2,...32) end |
Instance Attribute Details
#length ⇒ Object (readonly)
Returns the value of attribute length.
68 69 70 |
# File 'lib/abi_coder_rb/types.rb', line 68 def length @length end |
Instance Method Details
#==(other) ⇒ Object
83 84 85 |
# File 'lib/abi_coder_rb/types.rb', line 83 def ==(other) other.is_a?(FixedBytes) && @length == other.length end |
#format ⇒ Object
79 80 81 |
# File 'lib/abi_coder_rb/types.rb', line 79 def format "bytes#{@length}" end |
#size ⇒ Object
note: always uses 32 bytes (with padding)
75 76 77 |
# File 'lib/abi_coder_rb/types.rb', line 75 def size 32 end |