Module: Lockdown::Helper

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) administrator_group_name



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

def administrator_group_name
  'Administrators'
end

- (Regexp) regex(string)

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

- (Object) user_class



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

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

- (Object) user_group_class



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

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

- (Object) user_group_id_reference



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

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

- (Object) user_groups_hbtm_reference



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

- (Object) user_id_reference



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

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

- (Object) users_hbtm_reference



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

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