Class: RubyPitaya::Session

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSession

Returns a new instance of Session.



9
10
11
12
13
14
15
# File 'lib/rubypitaya/core/session.rb', line 9

def initialize
  @id = ''
  @uid = ''
  @data = {}
  @metadata = {}
  @frontend_id = ''
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



5
6
7
# File 'lib/rubypitaya/core/session.rb', line 5

def data
  @data
end

#frontend_idObject (readonly)

Returns the value of attribute frontend_id.



5
6
7
# File 'lib/rubypitaya/core/session.rb', line 5

def frontend_id
  @frontend_id
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/rubypitaya/core/session.rb', line 5

def id
  @id
end

#metadataObject (readonly)

Returns the value of attribute metadata.



5
6
7
# File 'lib/rubypitaya/core/session.rb', line 5

def 
  @metadata
end

#uidObject

Returns the value of attribute uid.



5
6
7
# File 'lib/rubypitaya/core/session.rb', line 5

def uid
  @uid
end

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/rubypitaya/core/session.rb', line 25

def authenticated?
  !@uid.strip.empty?
end

#clearObject



37
38
39
40
41
42
43
# File 'lib/rubypitaya/core/session.rb', line 37

def clear
  @id = ''
  @uid = ''
  @data = {}
  @metadata = {}
  @frontend_id = ''
end

#update(id, uid, data, metadata, frontend_id) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/rubypitaya/core/session.rb', line 17

def update(id, uid, data, , frontend_id)
  @id = id
  @uid = uid
  @data = data
  @metadata = 
  @frontend_id = frontend_id
end

#user_idObject



29
30
31
# File 'lib/rubypitaya/core/session.rb', line 29

def user_id
  @uid
end

#user_id=(value) ⇒ Object



33
34
35
# File 'lib/rubypitaya/core/session.rb', line 33

def user_id=(value)
  @uid = value
end