Class: Puppet::Network::ClientRequest
- Defined in:
- lib/vendor/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.
20 21 22 |
# File 'lib/vendor/puppet/network/client_request.rb', line 20 def initialize(name, ip, authenticated) @name, @ip, @authenticated = name, ip, authenticated end |
Instance Attribute Details
#authenticated ⇒ Object
Returns the value of attribute authenticated.
5 6 7 |
# File 'lib/vendor/puppet/network/client_request.rb', line 5 def authenticated @authenticated end |
#handler ⇒ Object
Returns the value of attribute handler.
5 6 7 |
# File 'lib/vendor/puppet/network/client_request.rb', line 5 def handler @handler end |
#ip ⇒ Object
Returns the value of attribute ip.
5 6 7 |
# File 'lib/vendor/puppet/network/client_request.rb', line 5 def ip @ip end |
#method ⇒ Object
Returns the value of attribute method.
5 6 7 |
# File 'lib/vendor/puppet/network/client_request.rb', line 5 def method @method end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/vendor/puppet/network/client_request.rb', line 5 def name @name end |
Instance Method Details
#authenticated? ⇒ Boolean
7 8 9 |
# File 'lib/vendor/puppet/network/client_request.rb', line 7 def authenticated? self.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.
14 15 16 17 18 |
# File 'lib/vendor/puppet/network/client_request.rb', line 14 def call raise ArgumentError, "Request is not set up; cannot build call" unless handler and method [handler, method].join(".") end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/vendor/puppet/network/client_request.rb', line 24 def to_s "#{self.name}(#{self.ip})" end |