Module: Law::Laws::Judgements

Extended by:
ActiveSupport::Concern
Included in:
Law::LawBase
Defined in:
lib/law/laws/judgements.rb

Instance Method Summary collapse

Instance Method Details

#authorize(action) ⇒ Object



23
24
25
# File 'lib/law/laws/judgements.rb', line 23

def authorize(action)
  judgement(action).tap(&:judge)
end

#authorize!(action) ⇒ Object



27
28
29
# File 'lib/law/laws/judgements.rb', line 27

def authorize!(action)
  judgement(action).tap(&:judge!)
end

#authorized?(action) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/law/laws/judgements.rb', line 31

def authorized?(action)
  judgement(action).judge
end

#judgement(action) ⇒ Object



19
20
21
# File 'lib/law/laws/judgements.rb', line 19

def judgement(action)
  Law::Judgement.new(petition_for_action(action))
end