class PublishToWeb::Config

Attributes

store[R]

Public Class Methods

config_attribute(name, key) click to toggle source
# File lib/publish_to_web/config.rb, line 6
def self.config_attribute(name, key)
  define_method name do
    store.get key
  end

  define_method "#{name}=" do |value|
    if value.nil?
      store.del key
    else
      store.set key, value
    end
  end
end
new(store: SKVS) click to toggle source
# File lib/publish_to_web/config.rb, line 20
def initialize(store: SKVS)
  @store = store
end

Public Instance Methods

active_accounts() click to toggle source
# File lib/publish_to_web/config.rb, line 43
def active_accounts
  store.get 'soul/active_accounts'
end
enabled?() click to toggle source
# File lib/publish_to_web/config.rb, line 24
def enabled?
  !!store.get('ptw/control/enabled')
end
support_identifier() click to toggle source
# File lib/publish_to_web/config.rb, line 47
def support_identifier
  identifier = store.get('system/support_identifier')
  if identifier.kind_of?(String) and identifier.strip.length > 0
    identifier
  end
end
system_version() click to toggle source
# File lib/publish_to_web/config.rb, line 54
def system_version
  parts = [store.get('system/channel'), store.get('system/release_number')]
  if parts.all? {|p| p.kind_of?(String) and p.strip.length > 0 }
    parts.join("/")
  else
    "unknown"
  end
end