Module: FeaturerWeb

Defined in:
lib/featurer_web.rb,
lib/featurer_web/engine.rb,
lib/featurer_web/version.rb,
app/helpers/featurer_web/featurer_helper.rb,
app/helpers/featurer_web/application_helper.rb,
app/controllers/featurer_web/features_controller.rb,
app/controllers/featurer_web/sessions_controller.rb,
app/controllers/featurer_web/application_controller.rb

Defined Under Namespace

Modules: ApplicationHelper, FeaturerHelper Classes: ApplicationController, Engine, FeaturesController, SessionsController

Constant Summary collapse

INVALD_ADMIN_USERS_MSG =
<<-MESSAGE.strip_heredoc
  admin_users must be an empty array or an array of hashes with the following format:
  [
    {
      username: "the_login_username",
      password_sha256: Digest::SHA256.digest("password")
    }
  ]
MESSAGE
VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.admin_usersObject



24
25
26
# File 'lib/featurer_web.rb', line 24

def self.admin_users
  @admin_users || []
end

.admin_users=(admin_users) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/featurer_web.rb', line 14

def self.admin_users=(admin_users)
  all_is_good = admin_users.is_a?(Array) && admin_users.all? do |admin_user|
    admin_user.is_a?(Hash) && admin_user[:username] && admin_user[:password_sha256]
  end

  raise INVALD_ADMIN_USERS_MSG unless all_is_good

  @admin_users = admin_users
end