Class: Pincers::Core::BaseFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/pincers/core/base_factory.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_options) ⇒ BaseFactory

Returns a new instance of BaseFactory.



9
10
11
12
# File 'lib/pincers/core/base_factory.rb', line 9

def initialize(_options)
  @context_options = extract_context_options _options
  @backend_options = _options
end

Class Method Details

.new_context(_options) ⇒ Object



5
6
7
# File 'lib/pincers/core/base_factory.rb', line 5

def self.new_context(_options)
  self.new(_options).new_context
end

Instance Method Details

#load_backend(_options) ⇒ Object

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/pincers/core/base_factory.rb', line 19

def load_backend(_options)
  raise NotImplementedError
end

#new_contextObject



14
15
16
17
# File 'lib/pincers/core/base_factory.rb', line 14

def new_context
  backend = load_backend @backend_options
  ::Pincers::Core::RootContext.new backend, @context_options
end