Class: RabbitMQHttpAuthBackend::Resolver::Runtime

Inherits:
BasicResolver show all
Defined in:
lib/rabbitmq_http_auth_backend/resolver/runtime.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Service

call, #call

Constructor Details

#initialize(params) ⇒ Runtime

Returns a new instance of Runtime.



9
10
11
12
13
# File 'lib/rabbitmq_http_auth_backend/resolver/runtime.rb', line 9

def initialize(params)
  super(params)
  self.tags = nil
  self._allowed = false
end

Instance Attribute Details

#_allowedObject

Returns the value of attribute _allowed.



7
8
9
# File 'lib/rabbitmq_http_auth_backend/resolver/runtime.rb', line 7

def _allowed
  @_allowed
end

#tagsObject

Returns the value of attribute tags.



6
7
8
# File 'lib/rabbitmq_http_auth_backend/resolver/runtime.rb', line 6

def tags
  @tags
end

Instance Method Details

#allow!(tags = nil) ⇒ Object



15
16
17
18
# File 'lib/rabbitmq_http_auth_backend/resolver/runtime.rb', line 15

def allow!(tags = nil)
  self._allowed = true
  self.tags = tags
end

#allowed?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/rabbitmq_http_auth_backend/resolver/runtime.rb', line 25

def allowed?
  _allowed == true
end

#denied?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/rabbitmq_http_auth_backend/resolver/runtime.rb', line 29

def denied?
  !allowed?
end

#deny!Object



20
21
22
23
# File 'lib/rabbitmq_http_auth_backend/resolver/runtime.rb', line 20

def deny!
  self._allowed = false
  self.tags = nil
end