Class: Etherlite::Configuration
- Inherits:
-
Object
- Object
- Etherlite::Configuration
- Includes:
- Railties::ConfigurationExtensions
- Defined in:
- lib/etherlite/railtie.rb,
lib/etherlite/configuration.rb
Overview
Add rails specifig related configuration parameters
Constant Summary collapse
- DEFAULTS =
{ url: 'http://127.0.0.1:8545', enable_nonce_cache: false, chain_id: nil, # any chain logger: nil # set by method }
Instance Attribute Summary collapse
-
#chain_id ⇒ Object
Returns the value of attribute chain_id.
-
#enable_nonce_cache ⇒ Object
Returns the value of attribute enable_nonce_cache.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes included from Railties::ConfigurationExtensions
Instance Method Summary collapse
- #assign_attributes(_options) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset ⇒ Object
Methods included from Railties::ConfigurationExtensions
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 |
# File 'lib/etherlite/configuration.rb', line 12 def initialize assign_attributes DEFAULTS end |
Instance Attribute Details
#chain_id ⇒ Object
Returns the value of attribute chain_id.
10 11 12 |
# File 'lib/etherlite/configuration.rb', line 10 def chain_id @chain_id end |
#enable_nonce_cache ⇒ Object
Returns the value of attribute enable_nonce_cache.
10 11 12 |
# File 'lib/etherlite/configuration.rb', line 10 def enable_nonce_cache @enable_nonce_cache end |
#logger ⇒ Object
Returns the value of attribute logger.
10 11 12 |
# File 'lib/etherlite/configuration.rb', line 10 def logger @logger end |
#url ⇒ Object
Returns the value of attribute url.
10 11 12 |
# File 'lib/etherlite/configuration.rb', line 10 def url @url end |
Instance Method Details
#assign_attributes(_options) ⇒ Object
20 21 22 23 |
# File 'lib/etherlite/configuration.rb', line 20 def assign_attributes() .each { |k, v| public_send("#{k}=", v) } self end |
#reset ⇒ Object
16 17 18 |
# File 'lib/etherlite/configuration.rb', line 16 def reset assign_attributes DEFAULTS end |