module Locomotive::Steam::Services

Public Class Methods

build_instance(request = nil) click to toggle source
# 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) click to toggle source

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

# 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