Sha256: ed88e9a3c69a663fd6e6b107da7b12c48b221847daa050cbe7dc9a24065d6be7

Contents?: true

Size: 854 Bytes

Versions: 2

Compression:

Stored size: 854 Bytes

Contents

module JmeterPerf
  class DSL
    def if_controller(params = {}, &)
      node = JmeterPerf::IfController.new(params)
      attach_node(node, &)
    end
  end

  class IfController
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "IfController" : (params[:name] || "IfController")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <IfController guiclass="IfControllerPanel" testclass="IfController" testname="#{testname}" enabled="true">
          <stringProp name="IfController.condition"/>
          <boolProp name="IfController.evaluateAll">false</boolProp>
          <boolProp name="IfController.useExpression">true</boolProp>
        </IfController>
      EOS
      update params
      update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jmeter_perf-0.0.6 lib/jmeter_perf/dsl/if_controller.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/if_controller.rb