Class: Stall::Config

Inherits:
Object
  • Object
show all
Extended by:
Utils::ConfigDSL
Defined in:
lib/stall/config.rb

Instance Method Summary collapse

Methods included from Utils::ConfigDSL

param

Instance Method Details

#default_app_domainObject



66
67
68
# File 'lib/stall/config.rb', line 66

def default_app_domain
  _default_app_domain || ENV['APP_DOMAIN']
end

#paymentObject



54
55
56
# File 'lib/stall/config.rb', line 54

def payment
  @payment ||= Stall::Payments::Config.new
end

#service_for(identifier) ⇒ Object

Fetch user config and add top-namespace lookup to avoid collision with Stall module services

Default allows looking up Stall namespace automatically, when no config has been given



75
76
77
78
79
80
81
82
83
# File 'lib/stall/config.rb', line 75

def service_for(identifier)
  class_name = if (service_name = services[identifier])
    "::#{ services[identifier].gsub(/^::/, '') }"
  else
    "Stall::#{ identifier.to_s.camelize }Service"
  end

  class_name.constantize
end

#services=(value) ⇒ Object



85
86
87
# File 'lib/stall/config.rb', line 85

def services=(value)
  self.services.merge!(value)
end

#shippingObject



50
51
52
# File 'lib/stall/config.rb', line 50

def shipping
  @shipping ||= Stall::Shipping::Config.new
end

#steps_initialization(value = nil, &block) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/stall/config.rb', line 58

def steps_initialization(value = nil, &block)
  if (value ||= block)
    @_steps_initialization_callback = value
  else
    @_steps_initialization_callback
  end
end