module Shoppe

Constants

VERSION

Public Class Methods

add_settings_group(group, fields = []) click to toggle source

Defines a new set of settings which should be configrable from the settings page in the Shoppe UI.

# File lib/shoppe.rb, line 43
def add_settings_group(group, fields = [])
  settings_groups[group]  ||= []
  settings_groups[group]    = settings_groups[group] | fields
end
reset_settings() click to toggle source

Clears the settings from the thread cache so they will be taken from the database on next access

@return [NilClass]

# File lib/shoppe.rb, line 37
def reset_settings
  Thread.current[:shoppe_settings] = nil
end
root() click to toggle source

The path to the root of the Shoppe application

@return [String]

# File lib/shoppe.rb, line 22
def root
  File.expand_path('../../', __FILE__)
end
settings() click to toggle source

Shoppe settings as configured in the database

@return [Shoppe::Settings]

# File lib/shoppe.rb, line 29
def settings
  Thread.current[:shoppe_settings] ||= Shoppe::Settings.new(Shoppe::Setting.to_hash)
end
settings_groups() click to toggle source

All settings groups which are available for configuration on the settings page.

@return [Hash]

# File lib/shoppe.rb, line 51
def settings_groups
  @settings_groups ||= {}
end