Class: Artisan::Stories::StoryPresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/artisan/stories/story_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#storyObject

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_nameObject



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_nameObject



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

#tagsObject



18
19
20
# File 'lib/artisan/stories/story_presenter.rb', line 18

def tags
  @story.tags.map(&:name)
end