Sha256: 0ba51549aa636a2897e78727a7f02d893a8ea9b23077482cdbe634ea9c263996
Contents?: true
Size: 982 Bytes
Versions: 6
Compression:
Stored size: 982 Bytes
Contents
# frozen_string_literal: true module Silkey # :nodoc: all class ContractFactory def self.call(params) new(params).call end def initialize(params = {}) @abi = params.fetch(:abi) @address = params.fetch(:address) @client_url = params.fetch(:client_url, Configuration.client_url) @name = params.fetch(:name) end def call @contract = create_contract contract end private attr_reader :abi, :address, :contract, :client_url, :name def client ClientFactory.call(client_url: client_url) end def create_contract Silkey::Contract.new(Ethereum::Contract.create( name: name, address: address, abi: abi, client: client ), client) end end end
Version data entries
6 entries across 6 versions & 1 rubygems