Class: TypeBalancer::Configuration
- Inherits:
-
Object
- Object
- TypeBalancer::Configuration
- Defined in:
- lib/type_balancer/configuration.rb
Overview
Configuration class to handle all balancing options
Instance Attribute Summary collapse
-
#batch_size ⇒ Object
Returns the value of attribute batch_size.
-
#strategy ⇒ Object
Returns the value of attribute strategy.
-
#strategy_options ⇒ Object
readonly
Returns the value of attribute strategy_options.
-
#type_field ⇒ Object
Returns the value of attribute type_field.
-
#type_order ⇒ Object
Returns the value of attribute type_order.
-
#types ⇒ Object
Returns the value of attribute types.
-
#window_size ⇒ Object
Returns the value of attribute window_size.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #merge_window_size ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 17 |
# File 'lib/type_balancer/configuration.rb', line 9 def initialize( = {}) @type_field = .fetch(:type_field, :type) @type_order = [:type_order] @strategy = [:strategy] @window_size = [:window_size] @batch_size = [:batch_size] @types = [:types] @strategy_options = () end |
Instance Attribute Details
#batch_size ⇒ Object
Returns the value of attribute batch_size.
6 7 8 |
# File 'lib/type_balancer/configuration.rb', line 6 def batch_size @batch_size end |
#strategy ⇒ Object
Returns the value of attribute strategy.
6 7 8 |
# File 'lib/type_balancer/configuration.rb', line 6 def strategy @strategy end |
#strategy_options ⇒ Object (readonly)
Returns the value of attribute strategy_options.
7 8 9 |
# File 'lib/type_balancer/configuration.rb', line 7 def @strategy_options end |
#type_field ⇒ Object
Returns the value of attribute type_field.
6 7 8 |
# File 'lib/type_balancer/configuration.rb', line 6 def type_field @type_field end |
#type_order ⇒ Object
Returns the value of attribute type_order.
6 7 8 |
# File 'lib/type_balancer/configuration.rb', line 6 def type_order @type_order end |
#types ⇒ Object
Returns the value of attribute types.
6 7 8 |
# File 'lib/type_balancer/configuration.rb', line 6 def types @types end |
#window_size ⇒ Object
Returns the value of attribute window_size.
6 7 8 |
# File 'lib/type_balancer/configuration.rb', line 6 def window_size @window_size end |
Instance Method Details
#merge_window_size ⇒ Object
19 20 21 22 23 |
# File 'lib/type_balancer/configuration.rb', line 19 def merge_window_size return unless window_size .merge(window_size: window_size) end |