class Shokkenki::Consumer::Configuration::ProviderConfiguration

Attributes

label[W]

Public Class Methods

new(name, stubber_classes) click to toggle source
# File lib/shokkenki/consumer/configuration/provider_configuration.rb, line 10
def initialize name, stubber_classes
  @name = name
  @stubber_classes = stubber_classes
end

Public Instance Methods

stub_with(stubber_name, attributes = {}) click to toggle source
# File lib/shokkenki/consumer/configuration/provider_configuration.rb, line 15
def stub_with stubber_name, attributes = {}
  stubber_class = @stubber_classes[stubber_name] || raise("No stubber found named '#{stubber_name}'.")
  @stubber = stubber_class.new attributes
end
to_provider() click to toggle source
# File lib/shokkenki/consumer/configuration/provider_configuration.rb, line 20
def to_provider
  Shokkenki::Consumer::Model::Provider.new(
    :stubber => @stubber,
    :name => @name,
    :label => @label
  )
end