Class: ProconBypassMan::BypassMode
- Inherits:
-
Object
- Object
- ProconBypassMan::BypassMode
- Defined in:
- lib/procon_bypass_man/procon/value_objects/bypass_mode.rb
Constant Summary collapse
- TYPE_NORMAL =
:normal
- TYPE_AGGRESSIVE =
:aggressive
- TYPES =
[TYPE_NORMAL, TYPE_AGGRESSIVE]
- DEFAULT_GADGET_TO_PROCON_INTERVAL =
0.5
Instance Attribute Summary collapse
-
#gadget_to_procon_interval ⇒ Object
Returns the value of attribute gadget_to_procon_interval.
-
#mode ⇒ Object
Returns the value of attribute mode.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(mode:, gadget_to_procon_interval:) ⇒ BypassMode
constructor
A new instance of BypassMode.
- #to_s ⇒ Object
Constructor Details
#initialize(mode:, gadget_to_procon_interval:) ⇒ BypassMode
Returns a new instance of BypassMode.
17 18 19 20 |
# File 'lib/procon_bypass_man/procon/value_objects/bypass_mode.rb', line 17 def initialize(mode: , gadget_to_procon_interval: ) @mode = mode.to_sym @gadget_to_procon_interval = gadget_to_procon_interval end |
Instance Attribute Details
#gadget_to_procon_interval ⇒ Object
Returns the value of attribute gadget_to_procon_interval.
8 9 10 |
# File 'lib/procon_bypass_man/procon/value_objects/bypass_mode.rb', line 8 def gadget_to_procon_interval @gadget_to_procon_interval end |
#mode ⇒ Object
Returns the value of attribute mode.
8 9 10 |
# File 'lib/procon_bypass_man/procon/value_objects/bypass_mode.rb', line 8 def mode @mode end |
Class Method Details
.default_value ⇒ Object
10 11 12 13 14 15 |
# File 'lib/procon_bypass_man/procon/value_objects/bypass_mode.rb', line 10 def self.default_value new( mode: TYPE_NORMAL, gadget_to_procon_interval: DEFAULT_GADGET_TO_PROCON_INTERVAL, ) end |
Instance Method Details
#to_s ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/procon_bypass_man/procon/value_objects/bypass_mode.rb', line 22 def to_s if mode == TYPE_NORMAL "#{mode}(#{gadget_to_procon_interval})" else mode.to_s end end |