Class: ABI::Type
- Inherits:
-
Object
- Object
- ABI::Type
- Defined in:
- lib/abicoder/types.rb,
lib/abicoder/parser.rb more...
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
permalink .parse(type) ⇒ Object
convenience helper
12 13 14 |
# File 'lib/abicoder/types.rb', line 12 def self.parse( type ) ## convenience helper Parser.parse( type ) end |
Instance Method Details
permalink #dynamic? ⇒ Boolean
25 |
# File 'lib/abicoder/types.rb', line 25 def dynamic?() size.nil?; end |
permalink #format ⇒ Object
27 28 29 30 |
# File 'lib/abicoder/types.rb', line 27 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 |
permalink #size ⇒ Integer, NilClass
Get the static size of a type, or nil if dynamic.
21 22 23 24 |
# File 'lib/abicoder/types.rb', line 21 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 |