Class: Logplex::Token
- Inherits:
-
Object
- Object
- Logplex::Token
- Defined in:
- lib/logplex/token.rb
Overview
A logplex token is required for publishing events to logplex.
To create a token, see Logplex::Channel#create_token.
Instance Attribute Summary collapse
-
#channel_id ⇒ Object
readonly
Returns the value of attribute channel_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
def initialize.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#emitter ⇒ Object
Public: Get an emitter suitable for publishing events with this token.
-
#initialize(url, channel_id, name, token_id) ⇒ Token
constructor
Public: initialize a Logplex::Token.
Constructor Details
#initialize(url, channel_id, name, token_id) ⇒ Token
Public: initialize a Logplex::Token
url - the url to logplex; see Logplex::Client.new for more info channel_id - the channel id to create a token on; see Logplex::Channel for
more info
name - the string name of this token. This name will appear in logplex
output (drains and log sessions) as the application name.
token_id - the token; usually in the form ‘t.SOME-UUID-VALUE’
22 23 24 25 26 27 |
# File 'lib/logplex/token.rb', line 22 def initialize(url, channel_id, name, token_id) @url = url @channel_id = channel_id @name = name @id = token_id end |
Instance Attribute Details
#channel_id ⇒ Object (readonly)
Returns the value of attribute channel_id.
31 32 33 |
# File 'lib/logplex/token.rb', line 31 def channel_id @channel_id end |
#id ⇒ Object
Returns the value of attribute id.
30 31 32 |
# File 'lib/logplex/token.rb', line 30 def id @id end |
#name ⇒ Object
def initialize
29 30 31 |
# File 'lib/logplex/token.rb', line 29 def name @name end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
32 33 34 |
# File 'lib/logplex/token.rb', line 32 def url @url end |