Module: WSDirector::Utils
- Included in:
- Protocols::Base, ScenarioReader
- Defined in:
- lib/wsdirector/utils.rb
Overview
:nodoc:
Constant Summary collapse
- MULTIPLIER_FORMAT =
/^[-+*\/\\\d ]+$/
Instance Attribute Summary collapse
-
#scale ⇒ Object
readonly
Returns the value of attribute scale.
Instance Method Summary collapse
Instance Attribute Details
#scale ⇒ Object (readonly)
Returns the value of attribute scale.
7 8 9 |
# File 'lib/wsdirector/utils.rb', line 7 def scale @scale end |
Instance Method Details
#parse_multiplier(str) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/wsdirector/utils.rb', line 9 def parse_multiplier(str) prepared = str.to_s.gsub(":scale", scale.to_s) raise WSDirector::Error, "Unknown multiplier format: #{str}" unless MULTIPLIER_FORMAT.match?(prepared) eval(prepared) # rubocop:disable Security/Eval end |