Module: Locomotive::Steam::Services

Defined in:
lib/locomotive/steam/services.rb,
lib/locomotive/steam/services/concerns/decorator.rb

Defined Under Namespace

Modules: Concerns Classes: Defer, Instance

Class Method Summary collapse

Class Method Details

.build_instance(request = nil) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/locomotive/steam/services.rb', line 10

def self.build_instance(request = nil)
  Instance.new(request).tap do |instance|
    if Locomotive::Steam.configuration.services_hook
      Locomotive::Steam.configuration.services_hook.call(instance)
    end
  end
end

.build_simple_instance(site) ⇒ Object

Used to get an easy access to some of the services (url_builder) without passing a request



20
21
22
23
24
# File 'lib/locomotive/steam/services.rb', line 20

def self.build_simple_instance(site)
  Instance.new(nil).tap do |instance|
    instance.current_site = site
  end
end