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.
-
#rsync_on_startup ⇒ Object
Returns the value of attribute rsync_on_startup.
-
#time_format ⇒ Object
Returns the value of attribute time_format.
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.
10 11 12 13 14 |
# File 'lib/vagrant-gatling-rsync/config.rb', line 10 def initialize @latency = UNSET_VALUE @time_format = UNSET_VALUE @rsync_on_startup = 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 |
#rsync_on_startup ⇒ Object
Returns the value of attribute rsync_on_startup.
8 9 10 |
# File 'lib/vagrant-gatling-rsync/config.rb', line 8 def rsync_on_startup @rsync_on_startup end |
#time_format ⇒ Object
Returns the value of attribute time_format.
7 8 9 |
# File 'lib/vagrant-gatling-rsync/config.rb', line 7 def time_format @time_format end |
Instance Method Details
#finalize! ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/vagrant-gatling-rsync/config.rb', line 16 def finalize! @latency = 1.5 if @latency == UNSET_VALUE @time_format = "%I:%M:%S %p" if @time_format == UNSET_VALUE if @rsync_on_startup == UNSET_VALUE @rsync_on_startup = true else @rsync_on_startup = !!@rsync_on_startup end end |
#validate(machine) ⇒ Object
@TODO: This does not appear to be called.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/vagrant-gatling-rsync/config.rb', line 27 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 |