Class: Bitsy::Config
- Inherits:
-
Object
- Object
- Bitsy::Config
- Defined in:
- lib/bitsy/config.rb
Instance Attribute Summary collapse
-
#blockchain ⇒ Object
Returns the value of attribute blockchain.
-
#blockchain_secrets ⇒ Object
Returns the value of attribute blockchain_secrets.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#safe_confirmation_threshold ⇒ Object
Returns the value of attribute safe_confirmation_threshold.
-
#send_many_log_path ⇒ Object
Returns the value of attribute send_many_log_path.
-
#transaction_fee ⇒ Object
Returns the value of attribute transaction_fee.
-
#transaction_fee_threshold_multiplier ⇒ Object
Returns the value of attribute transaction_fee_threshold_multiplier.
Instance Method Summary collapse
- #forward_threshold_amount ⇒ Object
-
#initialize(file_path) ⇒ Config
constructor
A new instance of Config.
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
#blockchain ⇒ Object
Returns the value of attribute blockchain.
4 5 6 |
# File 'lib/bitsy/config.rb', line 4 def blockchain @blockchain end |
#blockchain_secrets ⇒ Object
Returns the value of attribute blockchain_secrets.
4 5 6 |
# File 'lib/bitsy/config.rb', line 4 def blockchain_secrets @blockchain_secrets end |
#debug ⇒ Object
Returns the value of attribute debug.
4 5 6 |
# File 'lib/bitsy/config.rb', line 4 def debug @debug end |
#safe_confirmation_threshold ⇒ Object
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_path ⇒ Object
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_fee ⇒ Object
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_multiplier ⇒ Object
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_amount ⇒ Object
26 27 28 |
# File 'lib/bitsy/config.rb', line 26 def forward_threshold_amount transaction_fee * transaction_fee_threshold_multiplier end |