Class: Socrates::Core::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/socrates/core/session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id: nil, user: nil, channel: nil) ⇒ Session

Returns a new instance of Session.



8
9
10
11
12
13
# File 'lib/socrates/core/session.rb', line 8

def initialize(client_id: nil, user: nil, channel: nil)
  @client_id = client_id
  @user      = user
  @channel   = channel
  @messages  = Hash.new { |hash, key| hash[key] = [] }
end

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



6
7
8
# File 'lib/socrates/core/session.rb', line 6

def channel
  @channel
end

#client_idObject

Returns the value of attribute client_id.



6
7
8
# File 'lib/socrates/core/session.rb', line 6

def client_id
  @client_id
end

#messagesObject

Returns the value of attribute messages.



6
7
8
# File 'lib/socrates/core/session.rb', line 6

def messages
  @messages
end

#userObject

Returns the value of attribute user.



6
7
8
# File 'lib/socrates/core/session.rb', line 6

def user
  @user
end