Class: Puppet::Network::ClientRequest
- Defined in:
- lib/puppet/network/client_request.rb
Overview
A struct-like class for passing around a client request. It’s mostly just used for validation and authorization.
Instance Attribute Summary collapse
-
#authenticated ⇒ Object
Returns the value of attribute authenticated.
-
#handler ⇒ Object
Returns the value of attribute handler.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#method ⇒ Object
Returns the value of attribute method.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #authenticated? ⇒ Boolean
-
#call ⇒ Object
A common way of talking about the full call.
-
#initialize(name, ip, authenticated) ⇒ ClientRequest
constructor
A new instance of ClientRequest.
- #to_s ⇒ Object
Constructor Details
#initialize(name, ip, authenticated) ⇒ ClientRequest
Returns a new instance of ClientRequest.
22 23 24 25 26 |
# File 'lib/puppet/network/client_request.rb', line 22 def initialize(name, ip, authenticated) @name = name @ip = ip @authenticated = authenticated end |
Instance Attribute Details
#authenticated ⇒ Object
Returns the value of attribute authenticated.
7 8 9 |
# File 'lib/puppet/network/client_request.rb', line 7 def authenticated @authenticated end |
#handler ⇒ Object
Returns the value of attribute handler.
7 8 9 |
# File 'lib/puppet/network/client_request.rb', line 7 def handler @handler end |
#ip ⇒ Object
Returns the value of attribute ip.
7 8 9 |
# File 'lib/puppet/network/client_request.rb', line 7 def ip @ip end |
#method ⇒ Object
Returns the value of attribute method.
7 8 9 |
# File 'lib/puppet/network/client_request.rb', line 7 def method @method end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/puppet/network/client_request.rb', line 7 def name @name end |
Instance Method Details
#authenticated? ⇒ Boolean
9 10 11 |
# File 'lib/puppet/network/client_request.rb', line 9 def authenticated? authenticated end |
#call ⇒ Object
A common way of talking about the full call. Individual servers are responsible for setting the values correctly, but this common format makes it possible to check rights.
16 17 18 19 20 |
# File 'lib/puppet/network/client_request.rb', line 16 def call raise ArgumentError, _("Request is not set up; cannot build call") unless handler and method [handler, method].join(".") end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/puppet/network/client_request.rb', line 28 def to_s "#{name}(#{ip})" end |