class Pact::Provider::State::ProviderStates
Public Class Methods
Source
# File lib/pact/provider/state/provider_state.rb, line 34 def self.base_provider_state fullname = namespaced_name BASE_PROVIDER_STATE_NAME, {:for => current_namespaces.first } provider_states[fullname] ||= ProviderState.new(BASE_PROVIDER_STATE_NAME, current_namespaces.join('.')) provider_states[fullname] end
Source
# File lib/pact/provider/state/provider_state.rb, line 48 def self.current_namespaces @@current_namespaces ||= [] end
Source
# File lib/pact/provider/state/provider_state.rb, line 52 def self.get name, options = {} fullname = namespaced_name name, options (provider_states[fullname] || provider_states[fullname.to_sym] || provider_states[name]) end
Source
# File lib/pact/provider/state/provider_state.rb, line 57 def self.get_base opts = {} fullname = namespaced_name BASE_PROVIDER_STATE_NAME, opts provider_states[fullname] || NoOpProviderState end
Source
# File lib/pact/provider/state/provider_state.rb, line 62 def self.namespaced_name name, options = {} options[:for] ? "#{options[:for]}.#{name}" : name end
Source
# File lib/pact/provider/state/provider_state.rb, line 30 def self.provider_state name, &block ProviderState.build(name, current_namespaces.join('.'), &block) end
Source
# File lib/pact/provider/state/provider_state.rb, line 44 def self.provider_states @@provider_states ||= {} end
Source
# File lib/pact/provider/state/provider_state.rb, line 40 def self.register name, provider_state provider_states[name] = provider_state end