Class: CryptocoinPayable::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/cryptocoin_payable/config.rb

Defined Under Namespace

Classes: BchConfiguration, BtcConfiguration, CoinConfiguration, EthConfiguration

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bchObject

Returns the value of attribute bch.



12
13
14
# File 'lib/cryptocoin_payable/config.rb', line 12

def bch
  @bch
end

#btcObject

Returns the value of attribute btc.



12
13
14
# File 'lib/cryptocoin_payable/config.rb', line 12

def btc
  @btc
end

#currencyObject



15
16
17
# File 'lib/cryptocoin_payable/config.rb', line 15

def currency
  @currency ||= :usd
end

#ethObject

Returns the value of attribute eth.



12
13
14
# File 'lib/cryptocoin_payable/config.rb', line 12

def eth
  @eth
end

#expire_payments_afterObject

Returns the value of attribute expire_payments_after.



12
13
14
# File 'lib/cryptocoin_payable/config.rb', line 12

def expire_payments_after
  @expire_payments_after
end

#request_delayObject

Returns the value of attribute request_delay.



12
13
14
# File 'lib/cryptocoin_payable/config.rb', line 12

def request_delay
  @request_delay
end

#testnetObject

Returns the value of attribute testnet.



12
13
14
# File 'lib/cryptocoin_payable/config.rb', line 12

def testnet
  @testnet
end

Instance Method Details

#configure_bch {|@bch| ... } ⇒ Object

Yields:



24
25
26
27
# File 'lib/cryptocoin_payable/config.rb', line 24

def configure_bch
  @bch ||= BchConfiguration.new
  yield(@bch)
end

#configure_btc {|@btc| ... } ⇒ Object

Yields:



19
20
21
22
# File 'lib/cryptocoin_payable/config.rb', line 19

def configure_btc
  @btc ||= BtcConfiguration.new
  yield(@btc)
end

#configure_eth {|@eth| ... } ⇒ Object

Yields:



29
30
31
32
33
34
35
36
# File 'lib/cryptocoin_payable/config.rb', line 29

def configure_eth
  @eth ||= EthConfiguration.new
  yield(@eth)

  Eth.configure do |config|
    config.chain_id = CryptocoinPayable.configuration.testnet ? 4 : 1
  end
end