Class: SiteSettings::Manager

Inherits:
Object
  • Object
show all
Defined in:
app/services/site_settings/manager.rb

Constant Summary collapse

DEFAULT_SETTINGS =
{
  app_name: "The Artisans Company",
  app_short_name: "Artisans Company",
  app_url: "artisans.company",
  business_name: "Artisan Company Inc",
  business_address: "2261 Market Street",
  business_phone: "2099044448",
  business_email: "[email protected]",
  description: "Build a different outcome.",
  default_language: "EN",
  default_country: "NG",
  default_currency: "NGN",
  meta_title: "Artisans Company",
  meta_keywords: "venture studio, venture capital",
  meta_description: "Build a different outcome.",
  meta_author: "Artisans Company",
  logo: "logo.png",
  favicon: "favicon.ico",
  default_timezone: "WAT",
  app_version: "0.0.1"
}

Class Method Summary collapse

Class Method Details

.allObject



33
34
35
# File 'app/services/site_settings/manager.rb', line 33

def self.all
  DEFAULT_SETTINGS.keys.map { |key| [ key, get(key) ] }.to_h
end

.get(key) ⇒ Object



25
26
27
# File 'app/services/site_settings/manager.rb', line 25

def self.get(key)
  Setting.get(key) || DEFAULT_SETTINGS[key.to_sym]
end

.set(key, value) ⇒ Object



29
30
31
# File 'app/services/site_settings/manager.rb', line 29

def self.set(key, value)
  Setting.set(key, value)
end