Class: BinProxy::ProxyBaseItem
- Inherits:
-
Object
- Object
- BinProxy::ProxyBaseItem
- Includes:
- Logger
- Defined in:
- lib/binproxy/proxy_event.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#dest ⇒ Object
Returns the value of attribute dest.
-
#disposition ⇒ Object
Returns the value of attribute disposition.
-
#id ⇒ Object
Returns the value of attribute id.
-
#session ⇒ Object
Returns the value of attribute session.
-
#src ⇒ Object
Returns the value of attribute src.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize ⇒ ProxyBaseItem
constructor
A new instance of ProxyBaseItem.
- #to_hash ⇒ Object
Methods included from Logger
Constructor Details
#initialize ⇒ ProxyBaseItem
Returns a new instance of ProxyBaseItem.
15 16 17 |
# File 'lib/binproxy/proxy_event.rb', line 15 def initialize @time = Time.now end |
Instance Attribute Details
#dest ⇒ Object
Returns the value of attribute dest.
5 6 7 |
# File 'lib/binproxy/proxy_event.rb', line 5 def dest @dest end |
#disposition ⇒ Object
Returns the value of attribute disposition.
4 5 6 |
# File 'lib/binproxy/proxy_event.rb', line 4 def disposition @disposition end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/binproxy/proxy_event.rb', line 4 def id @id end |
#session ⇒ Object
Returns the value of attribute session.
4 5 6 |
# File 'lib/binproxy/proxy_event.rb', line 4 def session @session end |
#src ⇒ Object
Returns the value of attribute src.
5 6 7 |
# File 'lib/binproxy/proxy_event.rb', line 5 def src @src end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
5 6 7 |
# File 'lib/binproxy/proxy_event.rb', line 5 def time @time end |
Instance Method Details
#headers ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/binproxy/proxy_event.rb', line 19 def headers { message_id: @id, session_id: @session && @session.id, src: @src, dest: @dest, time: @time.to_i, disposition: @disposition, } end |
#to_hash ⇒ Object
30 31 32 |
# File 'lib/binproxy/proxy_event.rb', line 30 def to_hash { head: headers } end |