Class: Pantry::ClientInfo
- Inherits:
-
Object
- Object
- Pantry::ClientInfo
- Defined in:
- lib/pantry/client_info.rb
Overview
Simple class to keep track of a given client’s identifying information
Instance Attribute Summary collapse
-
#application ⇒ Object
readonly
Returns the value of attribute application.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#filter ⇒ Object
readonly
The above gets packaged into a ClientFilter for use elsewhere.
-
#identity ⇒ Object
readonly
This client’s current identity.
-
#roles ⇒ Object
readonly
Returns the value of attribute roles.
Instance Method Summary collapse
-
#initialize(application: nil, environment: nil, roles: [], identity: nil) ⇒ ClientInfo
constructor
A new instance of ClientInfo.
Constructor Details
#initialize(application: nil, environment: nil, roles: [], identity: nil) ⇒ ClientInfo
Returns a new instance of ClientInfo.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/pantry/client_info.rb', line 20 def initialize(application: nil, environment: nil, roles: [], identity: nil) @application = application @environment = environment @roles = roles @identity = identity @filter = Pantry::Communication::ClientFilter.new( application: @application, environment: @environment, roles: @roles, identity: @identity ) end |
Instance Attribute Details
#application ⇒ Object (readonly)
Returns the value of attribute application.
5 6 7 |
# File 'lib/pantry/client_info.rb', line 5 def application @application end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
7 8 9 |
# File 'lib/pantry/client_info.rb', line 7 def environment @environment end |
#filter ⇒ Object (readonly)
The above gets packaged into a ClientFilter for use elsewhere
12 13 14 |
# File 'lib/pantry/client_info.rb', line 12 def filter @filter end |
#identity ⇒ Object (readonly)
This client’s current identity. By default a client’s identity is it’s ‘hostname`, but a specific one can be given. These identities should be unique across the set of clients connecting to a single Pantry Server, behavior of multiple clients with the same identity is currently undefined.
18 19 20 |
# File 'lib/pantry/client_info.rb', line 18 def identity @identity end |
#roles ⇒ Object (readonly)
Returns the value of attribute roles.
9 10 11 |
# File 'lib/pantry/client_info.rb', line 9 def roles @roles end |