Module: SqAuth::SqAuthHelpers::RailsDSL

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

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/sq_auth/sq_auth_helpers/sq_auth_helpers_dsl.rb', line 46

def method_missing m, *args, &block
  begin
    super
  rescue NoMethodError
    if m[/^show_.+_to$/]
      format = m.to_s.scan(/^show_(.+)_to$/).flatten.first
      create_filter args, {:format_type => format}
    else
      raise NoMethodError
    end
  end
end

Instance Method Details

#access_action_except(*action, &block) ⇒ Object



42
43
44
# File 'lib/sq_auth/sq_auth_helpers/sq_auth_helpers_dsl.rb', line 42

def access_action_except *action, &block
  access_actions_except [*action], &block
end

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

Yields:

  • (block)


36
37
38
39
40
# File 'lib/sq_auth/sq_auth_helpers/sq_auth_helpers_dsl.rb', line 36

def access_actions_except *actions, &block
  @sq_auth_actions_except = *actions
  yield block if block_given?
  @sq_auth_actions_except = nil
end