Sha256: b5f0cdb45b5210771205212b0e899aded3eb2f17b347a4d45e5f91b59248bbef

Contents?: true

Size: 860 Bytes

Versions: 18

Compression:

Stored size: 860 Bytes

Contents

module Soaspec
  # Enables Exchange to store and retrieve variables so that one
  # exchange can make assertions based on a previous one
  module VariableStorer
    # Stores a value in the api handler that can be accessed by the provided name
    # @param [Symbol] name Name of method to use to access this value within handler
    # @param [String] value Path to value to store
    def store(name, value)
      exchange_handler.store(name, self[value])
    end

    # Retrieve the stored value from the Api Handler
    # @param [String, Symbol] name Name of value to retrieve
    # @return [Object] value from the Api Handler stored previously
    def retrieve(name)
      method = '__stored_val__' + name.to_s
      raise ArgumentError('Value not stored at ') unless exchange_handler.respond_to? method

      exchange_handler.send(method)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
soaspec-0.2.29 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.28 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.27 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.26 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.25 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.23 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.22 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.21 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.20 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.19 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.18 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.17 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.16 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.15 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.14 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.13 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.12 lib/soaspec/exchange/variable_storer.rb
soaspec-0.2.11 lib/soaspec/exchange/variable_storer.rb