Class: ABI::FixedBytes
Overview
class Bytes
Instance Attribute Summary collapse
-
#length ⇒ Object
readonly
Returns the value of attribute length.
Instance Method Summary collapse
- #==(another_type) ⇒ 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.
54 55 56 |
# File 'lib/abicoder/types.rb', line 54 def initialize( length ) @length = length # in bytes (1,2,...32) end |
Instance Attribute Details
#length ⇒ Object (readonly)
Returns the value of attribute length.
53 54 55 |
# File 'lib/abicoder/types.rb', line 53 def length @length end |
Instance Method Details
#==(another_type) ⇒ Object
59 60 61 |
# File 'lib/abicoder/types.rb', line 59 def ==(another_type) another_type.kind_of?( FixedBytes ) && @length == another_type.length end |
#format ⇒ Object
58 |
# File 'lib/abicoder/types.rb', line 58 def format() "bytes#{@length}"; end |
#size ⇒ Object
note: always uses 32 bytes (with padding)
57 |
# File 'lib/abicoder/types.rb', line 57 def size() 32; end |