Class: TEALrb::ABI::ABIDescription
- Inherits:
-
Object
- Object
- TEALrb::ABI::ABIDescription
- Defined in:
- lib/tealrb/abi.rb
Instance Attribute Summary collapse
-
#methods ⇒ Object
readonly
Returns the value of attribute methods.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #add_id(network, id) ⇒ Object
- #add_method(name:, desc:, args:, returns:, **_kwargs) ⇒ Object
-
#initialize ⇒ ABIDescription
constructor
A new instance of ABIDescription.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ ABIDescription
Returns a new instance of ABIDescription.
17 18 19 20 21 |
# File 'lib/tealrb/abi.rb', line 17 def initialize @name = '' @networks = {} @methods = [] end |
Instance Attribute Details
#methods ⇒ Object (readonly)
Returns the value of attribute methods.
15 16 17 |
# File 'lib/tealrb/abi.rb', line 15 def methods @methods end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/tealrb/abi.rb', line 14 def name @name end |
Instance Method Details
#add_id(network, id) ⇒ Object
32 33 34 |
# File 'lib/tealrb/abi.rb', line 32 def add_id(network, id) @networks[network] = { appID: id } end |
#add_method(name:, desc:, args:, returns:, **_kwargs) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/tealrb/abi.rb', line 23 def add_method(name:, desc:, args:, returns:, **_kwargs) @methods << { name: name, desc: desc, args: args, returns: { type: returns } } end |
#to_h ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/tealrb/abi.rb', line 36 def to_h { 'name' => @name, 'networks' => @networks, 'methods' => @methods } end |