Class: AbiCoderRb::Type
- Inherits:
-
Object
- Object
- AbiCoderRb::Type
- Defined in:
- lib/abi_coder_rb/types.rb,
lib/abi_coder_rb/parser.rb
Overview
for now use (get inspired)
by the type names used by abi coder in rust
see https://github.com/rust-ethereum/ethabi/blob/master/ethabi/src/param_type/param_type.rs
Direct Known Subclasses
Address, Array, Bool, Bytes, FixedArray, FixedBytes, Int, String, Tuple, Uint
Defined Under Namespace
Classes: ParseError, Parser
Class Method Summary collapse
-
.parse(type) ⇒ Object
convenience helper.
Instance Method Summary collapse
- #dynamic? ⇒ Boolean
- #format ⇒ Object
-
#size ⇒ Integer, NilClass
Get the static size of a type, or nil if dynamic.
Class Method Details
Instance Method Details
#dynamic? ⇒ Boolean
22 23 24 |
# File 'lib/abi_coder_rb/types.rb', line 22 def dynamic? size.nil? end |
#format ⇒ Object
26 27 28 29 |
# File 'lib/abi_coder_rb/types.rb', line 26 def format ## check/todo: what error to raise for not implemented / method not defined??? raise ArgumentError, "no required format method defined for Type subclass #{self.class.name}; sorry" end |
#size ⇒ Integer, NilClass
Get the static size of a type, or nil if dynamic.
17 18 19 20 |
# File 'lib/abi_coder_rb/types.rb', line 17 def size ## check/todo: what error to raise for not implemented / method not defined??? raise ArgumentError, "no required size method defined for Type subclass #{self.class.name}; sorry" end |