Class: AllStak::Models::UserContext
- Inherits:
-
Object
- Object
- AllStak::Models::UserContext
- Defined in:
- lib/allstak/models/user_context.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#id ⇒ Object
Returns the value of attribute id.
-
#ip ⇒ Object
Returns the value of attribute ip.
Instance Method Summary collapse
-
#initialize(id: nil, email: nil, ip: nil) ⇒ UserContext
constructor
A new instance of UserContext.
- #to_h ⇒ Object
Constructor Details
#initialize(id: nil, email: nil, ip: nil) ⇒ UserContext
Returns a new instance of UserContext.
6 7 8 9 10 |
# File 'lib/allstak/models/user_context.rb', line 6 def initialize(id: nil, email: nil, ip: nil) @id = id @email = email @ip = ip end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'lib/allstak/models/user_context.rb', line 4 def email @email end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/allstak/models/user_context.rb', line 4 def id @id end |
#ip ⇒ Object
Returns the value of attribute ip.
4 5 6 |
# File 'lib/allstak/models/user_context.rb', line 4 def ip @ip end |
Instance Method Details
#to_h ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/allstak/models/user_context.rb', line 12 def to_h out = {} out[:id] = @id unless @id.nil? out[:email] = @email unless @email.nil? out[:ip] = @ip unless @ip.nil? out end |