Class: Rst::UserPresenter
- Inherits:
-
Object
- Object
- Rst::UserPresenter
- Defined in:
- lib/rst/user_presenter.rb
Instance Method Summary collapse
- #description ⇒ Object
- #full_name ⇒ Object
-
#initialize(user) ⇒ UserPresenter
constructor
A new instance of UserPresenter.
- #to_s ⇒ Object
Constructor Details
#initialize(user) ⇒ UserPresenter
Returns a new instance of UserPresenter.
3 4 5 |
# File 'lib/rst/user_presenter.rb', line 3 def initialize(user) @user = user end |
Instance Method Details
#description ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/rst/user_presenter.rb', line 19 def description if @user.description == "" "No bio" else @user.description end end |
#full_name ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/rst/user_presenter.rb', line 11 def full_name if @user.full_name == "" "No full name" else @user.full_name end end |
#to_s ⇒ Object
7 8 9 |
# File 'lib/rst/user_presenter.rb', line 7 def to_s "#{@user.username} (#{full_name}): #{description}" end |