Class: Entrance::Agent::Acl::UrlBackendRouter

Inherits:
Base
  • Object
show all
Defined in:
lib/entrance/agent/acl/url_backend_router.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#as_digest, #comparator, #name, #value

Instance Method Summary collapse

Methods inherited from Base

#acl, #condition, #label

Constructor Details

#initialize(params = {}) ⇒ UrlBackendRouter

Returns a new instance of UrlBackendRouter.



8
9
10
11
12
# File 'lib/entrance/agent/acl/url_backend_router.rb', line 8

def initialize params={}
  @url     = params[:url]
  @backend = params[:backend]
  super params.merge(comparator:"hdr(host) -i",value:url,name:url)
end

Instance Attribute Details

#backendObject

Returns the value of attribute backend.



7
8
9
# File 'lib/entrance/agent/acl/url_backend_router.rb', line 7

def backend
  @backend
end

#urlObject

Returns the value of attribute url.



7
8
9
# File 'lib/entrance/agent/acl/url_backend_router.rb', line 7

def url
  @url
end

Instance Method Details

#applyObject



13
14
15
16
17
18
19
# File 'lib/entrance/agent/acl/url_backend_router.rb', line 13

def apply
  @apply = []
  @apply << "use_backend"
  @apply << backend.application
  @apply << condition
  @apply.join(" ")
end