Class: PolarLoop::GasStrategy
- Inherits:
-
Object
- Object
- PolarLoop::GasStrategy
- Defined in:
- lib/polarloop/gas_strategy.rb
Instance Attribute Summary collapse
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(chain_id, eth_client) ⇒ GasStrategy
constructor
A new instance of GasStrategy.
- #legacy? ⇒ Boolean
Constructor Details
#initialize(chain_id, eth_client) ⇒ GasStrategy
Returns a new instance of GasStrategy.
32 33 34 |
# File 'lib/polarloop/gas_strategy.rb', line 32 def initialize(chain_id, eth_client) @strategy = self.class.for_chain(chain_id, eth_client) end |
Instance Attribute Details
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
30 31 32 |
# File 'lib/polarloop/gas_strategy.rb', line 30 def strategy @strategy end |
Class Method Details
.for_chain(chain_id, eth_client) ⇒ Object
8 9 10 |
# File 'lib/polarloop/gas_strategy.rb', line 8 def for_chain(chain_id, eth_client) @cache[chain_id] ||= detect(chain_id, eth_client) end |
.reset! ⇒ Object
12 13 14 |
# File 'lib/polarloop/gas_strategy.rb', line 12 def reset! @cache = {} end |
Instance Method Details
#legacy? ⇒ Boolean
36 37 38 |
# File 'lib/polarloop/gas_strategy.rb', line 36 def legacy? @strategy == :legacy end |