Module: SnFoil::Policy

Extended by:
ActiveSupport::Concern
Defined in:
lib/snfoil/policy.rb,
lib/snfoil/policy/version.rb

Overview

ActiveSupport::Concern for adding SnFoil Policy functionality to policy file

Author:

  • Matthew Howes

Since:

  • 0.1.0

Defined Under Namespace

Classes: Error, Scope

Constant Summary collapse

VERSION =

Since:

  • 0.1.0

'1.1.1'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#entityObject (readonly)

Since:

  • 0.1.0



55
56
57
# File 'lib/snfoil/policy.rb', line 55

def entity
  @entity
end

#optionsObject

Since:

  • 0.1.0



56
57
58
# File 'lib/snfoil/policy.rb', line 56

def options
  @options
end

#recordObject (readonly)

Since:

  • 0.1.0



55
56
57
# File 'lib/snfoil/policy.rb', line 55

def record
  @record
end

Instance Method Details

#initialize(entity, record, **options) ⇒ Object

Since:

  • 0.1.0



58
59
60
61
62
# File 'lib/snfoil/policy.rb', line 58

def initialize(entity, record, **options)
  @record = record
  @entity = entity
  @options = options
end