Module: Lockdown::Helper

Included in:
Lockdown
Defined in:
lib/lockdown/helper.rb

Instance Method Summary collapse

Instance Method Details

#administrator_group_nameObject



14
15
16
# File 'lib/lockdown/helper.rb', line 14

def administrator_group_name
  'Administrators'
end

#regex(string) ⇒ Regexp

Returns with A z boundaries.

Returns:

  • (Regexp)

    with A z boundaries



10
11
12
# File 'lib/lockdown/helper.rb', line 10

def regex(string)
  Regexp.new(/\A#{string}\z/)
end

#user_classObject



30
31
32
# File 'lib/lockdown/helper.rb', line 30

def user_class
  eval("::#{Lockdown::Configuration.user_model}")
end

#user_group_classObject



18
19
20
# File 'lib/lockdown/helper.rb', line 18

def user_group_class
  eval("::#{Lockdown::Configuration.user_group_model}")
end

#user_group_id_referenceObject



26
27
28
# File 'lib/lockdown/helper.rb', line 26

def user_group_id_reference
  Lockdown::Configuration.user_group_model.underscore + "_id"
end

#user_groups_hbtm_referenceObject



22
23
24
# File 'lib/lockdown/helper.rb', line 22

def user_groups_hbtm_reference
  Lockdown::Configuration.user_group_model.underscore.pluralize.to_sym
end

#user_id_referenceObject



38
39
40
# File 'lib/lockdown/helper.rb', line 38

def user_id_reference
  Lockdown::Configuration.user_model.underscore + "_id"
end

#users_hbtm_referenceObject



34
35
36
# File 'lib/lockdown/helper.rb', line 34

def users_hbtm_reference
  Lockdown::Configuration.user_model.underscore.pluralize.to_sym
end