Module: SqAuth::SqAuthHelpers::DSL

Included in:
ActionController::ClassMethods, Sinatra
Defined in:
lib/sq_auth/sq_auth_helpers/sq_auth_helpers_dsl.rb

Instance Method Summary collapse

Instance Method Details

#access_action(*action, &block) ⇒ Object



14
15
16
# File 'lib/sq_auth/sq_auth_helpers/sq_auth_helpers_dsl.rb', line 14

def access_action *action, &block
  access_actions [*action], &block
end

#access_actions(*actions) {|block| ... } ⇒ Object

Yields:

  • (block)


8
9
10
11
12
# File 'lib/sq_auth/sq_auth_helpers/sq_auth_helpers_dsl.rb', line 8

def access_actions *actions, &block
  @sq_auth_actions_only = *actions
  yield block if block_given?
  @sq_auth_actions_only = nil
end

#draw_for(*roles, &block) ⇒ Object



20
21
22
# File 'lib/sq_auth/sq_auth_helpers/sq_auth_helpers_dsl.rb', line 20

def draw_for *roles, &block
  access_for([*roles], &block)
end

#sq_auth_access(&block) ⇒ Object



4
5
6
# File 'lib/sq_auth/sq_auth_helpers/sq_auth_helpers_dsl.rb', line 4

def sq_auth_access &block
  self.instance_eval &block
end