Class: Logtail::Contexts::Session
- Inherits:
- 
      Logtail::Context
      
        - Object
- Logtail::Context
- Logtail::Contexts::Session
 
- Defined in:
- lib/logtail/contexts/session.rb
Instance Attribute Summary collapse
- 
  
    
      #id  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute id. 
Instance Method Summary collapse
- 
  
    
      #initialize(attributes)  ⇒ Session 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Session. 
- 
  
    
      #to_hash  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Builds a hash representation containing simple objects, suitable for serialization (JSON). 
Constructor Details
#initialize(attributes) ⇒ Session
Returns a new instance of Session.
| 10 11 12 | # File 'lib/logtail/contexts/session.rb', line 10 def initialize(attributes) @id = attributes[:id] end | 
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
| 8 9 10 | # File 'lib/logtail/contexts/session.rb', line 8 def id @id end | 
Instance Method Details
#to_hash ⇒ Object
Builds a hash representation containing simple objects, suitable for serialization (JSON).
| 15 16 17 18 19 20 21 | # File 'lib/logtail/contexts/session.rb', line 15 def to_hash @to_hash ||= { session: Util::NonNilHashBuilder.build do |h| h.add(:id, id) end } end |