Class: RubyPitaya::Session
- Defined in:
- lib/rubypitaya/core/session.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rubypitaya-3.12.1/lib/rubypitaya/core/session.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#frontend_id ⇒ Object
readonly
Returns the value of attribute frontend_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#uid ⇒ Object
Returns the value of attribute uid.
Instance Method Summary collapse
- #authenticated? ⇒ Boolean
- #clear ⇒ Object
-
#initialize ⇒ Session
constructor
A new instance of Session.
- #update(id, uid, data, metadata, frontend_id) ⇒ Object
- #user_id ⇒ Object
- #user_id=(value) ⇒ Object
Constructor Details
#initialize ⇒ Session
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
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/rubypitaya/core/session.rb', line 5 def data @data end |
#frontend_id ⇒ Object (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 |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/rubypitaya/core/session.rb', line 5 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
5 6 7 |
# File 'lib/rubypitaya/core/session.rb', line 5 def @metadata end |
#uid ⇒ Object
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
25 26 27 |
# File 'lib/rubypitaya/core/session.rb', line 25 def authenticated? !@uid.strip.empty? end |
#clear ⇒ Object
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_id ⇒ Object
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 |