Class: Lavin::User
- Inherits:
-
Object
- Object
- Lavin::User
- Defined in:
- lib/lavin/user.rb
Instance Attribute Summary collapse
-
#user_index ⇒ Object
readonly
Returns the value of attribute user_index.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**options) ⇒ User
constructor
A new instance of User.
- #user_name ⇒ Object
Constructor Details
#initialize(**options) ⇒ User
Returns a new instance of User.
32 33 34 |
# File 'lib/lavin/user.rb', line 32 def initialize(**) @user_index = .delete(:user_index) end |
Instance Attribute Details
#user_index ⇒ Object (readonly)
Returns the value of attribute user_index.
30 31 32 |
# File 'lib/lavin/user.rb', line 30 def user_index @user_index end |
Class Method Details
.all_personas ⇒ Object
22 23 24 |
# File 'lib/lavin/user.rb', line 22 def self.all_personas @all_personas ||= Set.new end |
.inherited(subclass) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/lavin/user.rb', line 12 def self.inherited(subclass) super subclass.include UserConfig subclass.include Worker subclass.include HttpClient subclass.include Failure subclass.include Success all_personas << subclass end |
.personas ⇒ Object
26 27 28 |
# File 'lib/lavin/user.rb', line 26 def self.personas all_personas.select(&:enabled?) end |
Instance Method Details
#user_name ⇒ Object
36 37 38 |
# File 'lib/lavin/user.rb', line 36 def user_name "#{name}##{user_index}" end |