Class: Bitsy::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ Config

Returns a new instance of Config.



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/bitsy/config.rb', line 14

def initialize(file_path)
  @config ||= YAML.load_file(file_path).
    with_indifferent_access.
    fetch(Rails.env.to_s)

  @config.each do |k, v|
    self.class.send :define_method, k do
      @config.fetch(k)
    end
  end
end

Instance Attribute Details

#blockchainObject

Returns the value of attribute blockchain.



4
5
6
# File 'lib/bitsy/config.rb', line 4

def blockchain
  @blockchain
end

#blockchain_secretsObject

Returns the value of attribute blockchain_secrets.



4
5
6
# File 'lib/bitsy/config.rb', line 4

def blockchain_secrets
  @blockchain_secrets
end

#debugObject

Returns the value of attribute debug.



4
5
6
# File 'lib/bitsy/config.rb', line 4

def debug
  @debug
end

#safe_confirmation_thresholdObject

Returns the value of attribute safe_confirmation_threshold.



4
5
6
# File 'lib/bitsy/config.rb', line 4

def safe_confirmation_threshold
  @safe_confirmation_threshold
end

#send_many_log_pathObject

Returns the value of attribute send_many_log_path.



4
5
6
# File 'lib/bitsy/config.rb', line 4

def send_many_log_path
  @send_many_log_path
end

#transaction_feeObject

Returns the value of attribute transaction_fee.



4
5
6
# File 'lib/bitsy/config.rb', line 4

def transaction_fee
  @transaction_fee
end

#transaction_fee_threshold_multiplierObject

Returns the value of attribute transaction_fee_threshold_multiplier.



4
5
6
# File 'lib/bitsy/config.rb', line 4

def transaction_fee_threshold_multiplier
  @transaction_fee_threshold_multiplier
end

Instance Method Details

#forward_threshold_amountObject



26
27
28
# File 'lib/bitsy/config.rb', line 26

def forward_threshold_amount
  transaction_fee * transaction_fee_threshold_multiplier
end