class SPV::Options

Keeps options which are used to identify path to fixtures and options for a waiter which holds execution until expectation has been met.

Attributes

shortcut_paths[RW]
waiter[RW]
waiter_options[RW]

Public Class Methods

new(options = {}) click to toggle source
# File lib/site_prism_vcr/options.rb, line 8
def initialize(options = {})
  @shortcut_paths = {}

  options.each do |key, val|
    public_send("#{key}=", val)
  end
end

Public Instance Methods

add_shortcut_path(shortcut, path) click to toggle source

Defines shortcut path to fixtures.

@param shortcut [String] @param path [String] Path to fixtures.

@return [void]

@api private

# File lib/site_prism_vcr/options.rb, line 24
def add_shortcut_path(shortcut, path)
  path << '/' unless path[-1, 1] == '/'

  self.shortcut_paths[shortcut] = path
end
clone_options() click to toggle source

Returns a copy of itself.

@return [SPV::Options]

@api private

# File lib/site_prism_vcr/options.rb, line 46
def clone_options
  dup
end
merge_waiter_options!(options) click to toggle source

Merges already defined waiter's options with a given hash.

If waiter's options are not defined yet, it will define waiter options with a given hash.

@return [void]

@api private

# File lib/site_prism_vcr/options.rb, line 68
def merge_waiter_options!(options)
  self.waiter_options = self.waiter_options.merge(options)
end
shortcut_path(shortcut) click to toggle source

Returns a full path associated with a shortcut.

@param shortcut [String]

@return [String]

@api private

# File lib/site_prism_vcr/options.rb, line 37
def shortcut_path(shortcut)
  self.shortcut_paths[shortcut]
end