Class: KablameUser
- Inherits:
-
Object
- Object
- KablameUser
- Defined in:
- lib/kablame.rb
Instance Attribute Summary collapse
-
#line_count ⇒ Object
Returns the value of attribute line_count.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #increment ⇒ Object
-
#initialize(name) ⇒ KablameUser
constructor
A new instance of KablameUser.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ KablameUser
Returns a new instance of KablameUser.
84 85 86 87 |
# File 'lib/kablame.rb', line 84 def initialize(name) @line_count = 1 @name = name end |
Instance Attribute Details
#line_count ⇒ Object
Returns the value of attribute line_count.
81 82 83 |
# File 'lib/kablame.rb', line 81 def line_count @line_count end |
#name ⇒ Object
Returns the value of attribute name.
82 83 84 |
# File 'lib/kablame.rb', line 82 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
89 90 91 |
# File 'lib/kablame.rb', line 89 def <=>(other) other.line_count <=> @line_count end |
#increment ⇒ Object
97 98 99 |
# File 'lib/kablame.rb', line 97 def increment @line_count = @line_count.next end |
#to_s ⇒ Object
93 94 95 |
# File 'lib/kablame.rb', line 93 def to_s "#{@name.ljust(20)} ==> #{@line_count.to_s.rjust(4)}" end |