Class: Eth::Contract::FunctionInput

Inherits:
Object
  • Object
show all
Defined in:
lib/eth/contract/function_input.rb

Overview

Provide classes for contract function input.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ FunctionInput

Constructor of the Eth::Contract::FunctionInput class.

Parameters:

  • data (Hash)

    contract abi data.



27
28
29
30
31
# File 'lib/eth/contract/function_input.rb', line 27

def initialize(data)
  @raw_type = data["type"]
  @type = Eth::Abi::Type.parse(data["type"], data["components"])
  @name = data["name"]
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



22
23
24
# File 'lib/eth/contract/function_input.rb', line 22

def name
  @name
end

#raw_typeObject

Returns the value of attribute raw_type.



22
23
24
# File 'lib/eth/contract/function_input.rb', line 22

def raw_type
  @raw_type
end

#typeObject

Returns complete types with subtypes, e.g., uint256.



34
35
36
# File 'lib/eth/contract/function_input.rb', line 34

def type
  @type
end

Instance Method Details

#parsed_typeObject

Returns parsed types.



39
40
41
# File 'lib/eth/contract/function_input.rb', line 39

def parsed_type
  @type
end