Exception: Authz::Scopables::Base::UnresolvableKeyword

Inherits:
StandardError
  • Object
show all
Defined in:
lib/authz/scopables/base.rb

Overview

Raised when the .resolve_keyword method returns invalid output

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ UnresolvableKeyword

Returns a new instance of UnresolvableKeyword.



145
146
147
148
149
150
151
152
153
# File 'lib/authz/scopables/base.rb', line 145

def initialize(options = {})
  scopable  = options.fetch(:scopable)
  keyword   = options.fetch(:keyword)
  requester   = options.fetch(:requester)
  message = "Unresolvable keyword '#{keyword}' with requester" \
            "#{requester} in #{scopable}. Make sure that " \
            '.resolve_keyword returns an array. e.g. [2, 5, nil]'
  super(message)
end

Instance Attribute Details

#keywordObject (readonly)



143
144
145
# File 'lib/authz/scopables/base.rb', line 143

def keyword
  @keyword
end

#requesterObject (readonly)



143
144
145
# File 'lib/authz/scopables/base.rb', line 143

def requester
  @requester
end

#scopableObject (readonly)



143
144
145
# File 'lib/authz/scopables/base.rb', line 143

def scopable
  @scopable
end