Module: HoneyPotEngine::ControllerGuard

Extended by:
ActiveSupport::Concern
Defined in:
lib/honey_pot_engine/controller_guard.rb

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/honey_pot_engine/controller_guard.rb', line 5

def self.prepended(base)
  # prepend の時点でクラスに特異メソッドを定義
  base.class_eval do
    @skip_honeypot_check = false

    def self.skip_honeypot!
      @skip_honeypot_check = true
    end

    def self.honeypot_skipped?
      @skip_honeypot_check == true
    end
  end

  base.before_action :check_honeypot
end