Class: Artisan::Stories::StoryPresenter
- Inherits:
-
Object
- Object
- Artisan::Stories::StoryPresenter
- Defined in:
- lib/artisan/stories/story_presenter.rb
Instance Attribute Summary collapse
-
#story ⇒ Object
Returns the value of attribute story.
Instance Method Summary collapse
- #assigned_user_name ⇒ Object
-
#initialize(story) ⇒ StoryPresenter
constructor
A new instance of StoryPresenter.
- #short_name ⇒ Object
- #tags ⇒ Object
Constructor Details
#initialize(story) ⇒ StoryPresenter
Returns a new instance of StoryPresenter.
6 7 8 |
# File 'lib/artisan/stories/story_presenter.rb', line 6 def initialize(story) @story= story end |
Instance Attribute Details
#story ⇒ Object
Returns the value of attribute story.
4 5 6 |
# File 'lib/artisan/stories/story_presenter.rb', line 4 def story @story end |
Instance Method Details
#assigned_user_name ⇒ Object
14 15 16 |
# File 'lib/artisan/stories/story_presenter.rb', line 14 def assigned_user_name !@story.assigned_user.nil? ? @story.assigned_user.full_name : "Not Assigned" end |
#short_name ⇒ Object
10 11 12 |
# File 'lib/artisan/stories/story_presenter.rb', line 10 def short_name @story.name.length <= 30 ? @story.name : (@story.name[0..26] + "...") end |
#tags ⇒ Object
18 19 20 |
# File 'lib/artisan/stories/story_presenter.rb', line 18 def @story..map(&:name) end |