Class: Web3::Eth::Contract::ContractInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(contract, address) ⇒ ContractInstance

Returns a new instance of ContractInstance.



7
8
9
10
# File 'lib/web3ethereum/contract.rb', line 7

def initialize contract, address
  @contract = contract
  @address = address
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



12
13
14
# File 'lib/web3ethereum/contract.rb', line 12

def method_missing m, *args
  @contract.call_contract @address, m.to_s, args
end

Instance Method Details

#__address__Object



20
21
22
# File 'lib/web3ethereum/contract.rb', line 20

def __address__
  @address
end

#__contract__Object



16
17
18
# File 'lib/web3ethereum/contract.rb', line 16

def __contract__
  @contract
end