Class: VagrantPlugins::GatlingRsync::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::GatlingRsync::Config
- Defined in:
- lib/vagrant-gatling-rsync/config.rb
Instance Attribute Summary collapse
-
#latency ⇒ Object
Returns the value of attribute latency.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
-
#validate(machine) ⇒ Object
@TODO: This does not appear to be called.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
8 9 10 |
# File 'lib/vagrant-gatling-rsync/config.rb', line 8 def initialize @latency = UNSET_VALUE end |
Instance Attribute Details
#latency ⇒ Object
Returns the value of attribute latency.
6 7 8 |
# File 'lib/vagrant-gatling-rsync/config.rb', line 6 def latency @latency end |
Instance Method Details
#finalize! ⇒ Object
12 13 14 |
# File 'lib/vagrant-gatling-rsync/config.rb', line 12 def finalize! @latency = 1.5 if @latency == UNSET_VALUE end |
#validate(machine) ⇒ Object
@TODO: This does not appear to be called.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/vagrant-gatling-rsync/config.rb', line 17 def validate(machine) errors = _detected_errors if @latency == UNSET_VALUE return elsif not @latency.is_a? Numeric @latency = 1.5 # @TODO: Translate. errors << "The latency must be set to a number. Substituting 1.5 as a value." elsif @latency < 0.2 @latency = 0.2 # @TODO: Translate. errors << "The latency may not be below 0.2 seconds." end { "gatling" => errors } end |