Class: Trajectory::Story
- Inherits:
-
Object
- Object
- Trajectory::Story
- Includes:
- Virtus
- Defined in:
- lib/trajectory/domain/story.rb
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Returns true if two stories are the sames i.e they share the same id attribute.
-
#archived? ⇒ true, false
True if the story has been archived, false otherwise.
-
#assignee_name ⇒ String
The name of the user assigned to the story.
-
#comments_count ⇒ Integer
Number of comments of the story.
-
#completed? ⇒ true, false
Returns true if the story is completed i.e in :accepted state.
-
#created_at ⇒ DateTime
The creation date of the story.
-
#deleted? ⇒ ture, false
True if the story has been deleted, false otherwise.
-
#design_needed ⇒ true, false
True if design is needed for the story, false otherwise.
-
#development_needed? ⇒ true, false
True if development is needed for the story, false otherwise.
-
#id ⇒ Integer
The unique identifier of the story.
-
#idea_subject ⇒ String
The subject of the idea the story is attached to.
-
#in_iteration?(iteration) ⇒ true, false
Returns true if the story belongs to the given iteration, false otherwise.
-
#iteration ⇒ Iteration, false
Returns the iteration the story belongs to or false if iteration can’t be found.
-
#iteration_id ⇒ Integer
Iteration id the story belongs to.
-
#not_completed? ⇒ true, false
Returns true if the story is not completed i.e not in :accepted state.
-
#points ⇒ Integer
Estimation in points of the story complexity.
-
#position ⇒ Integer
The Integer position of the story in the backlog.
-
#project ⇒ Project
Fetch the project the story belongs to.
-
#project_id ⇒ Integer
Project id the story belongs to.
-
#started? ⇒ true, false
Returns true if the story is started i.e in :started state.
-
#state ⇒ Symbol
State of the story in [:started, :unstarted, :delivered, :accepted, :rejected].
-
#state_events ⇒ Array<Symbol>
The valid states the story can transition to.
-
#task_type ⇒ String
The type of story as “Feature”, “Bug”, “Todo” or “Milestone”.
-
#title ⇒ String
The title of the story.
-
#unstarted? ⇒ true, false
Returns true if the story is not started i.e in :unstarted state.
-
#updated_at ⇒ DateTime
The last modification date of the story.
-
#user ⇒ User
Fetch the user that created the story.
-
#user_id ⇒ Integer
Id of the user that created the story.
-
#user_name ⇒ String
Name of the user that created the story.
Instance Method Details
#==(other) ⇒ true, false
Returns true if two stories are the sames i.e they share the same id attribute
60 61 62 |
# File 'lib/trajectory/domain/story.rb', line 60 def ==(other) id == other.id end |
#archived? ⇒ true, false
Returns true if the story has been archived, false otherwise.
30 |
# File 'lib/trajectory/domain/story.rb', line 30 attribute :archived, Boolean |
#assignee_name ⇒ String
Returns the name of the user assigned to the story.
9 |
# File 'lib/trajectory/domain/story.rb', line 9 attribute :assignee_name, String |
#comments_count ⇒ Integer
Returns number of comments of the story.
45 |
# File 'lib/trajectory/domain/story.rb', line 45 attribute :comments_count, Integer |
#completed? ⇒ true, false
Returns true if the story is completed i.e in :accepted state
95 96 97 |
# File 'lib/trajectory/domain/story.rb', line 95 def completed? state == :accepted end |
#created_at ⇒ DateTime
Returns the creation date of the story.
17 |
# File 'lib/trajectory/domain/story.rb', line 17 attribute :created_at, DateTime |
#deleted? ⇒ ture, false
Returns true if the story has been deleted, false otherwise.
38 |
# File 'lib/trajectory/domain/story.rb', line 38 attribute :deleted, Boolean |
#design_needed ⇒ true, false
Returns true if design is needed for the story, false otherwise.
23 |
# File 'lib/trajectory/domain/story.rb', line 23 attribute :design_needed, Boolean |
#development_needed? ⇒ true, false
Returns true if development is needed for the story, false otherwise.
35 |
# File 'lib/trajectory/domain/story.rb', line 35 attribute :development_needed, Boolean |
#id ⇒ Integer
Returns the unique identifier of the story.
7 |
# File 'lib/trajectory/domain/story.rb', line 7 attribute :id, Integer, default: lambda { |project, attribute| raise MissingAttributeError.new(project, :id) } |
#idea_subject ⇒ String
Returns the subject of the idea the story is attached to.
27 |
# File 'lib/trajectory/domain/story.rb', line 27 attribute :idea_subject, String |
#in_iteration?(iteration) ⇒ true, false
Returns true if the story belongs to the given iteration, false otherwise
110 111 112 |
# File 'lib/trajectory/domain/story.rb', line 110 def in_iteration?(iteration) iteration_id == iteration.id end |
#iteration ⇒ Iteration, false
Returns the iteration the story belongs to or false if iteration can’t be found
118 119 120 |
# File 'lib/trajectory/domain/story.rb', line 118 def iteration @iteration ||= DataStore.find_iteration_of_project_by_id(project, iteration_id) end |
#iteration_id ⇒ Integer
Returns iteration id the story belongs to.
53 |
# File 'lib/trajectory/domain/story.rb', line 53 attribute :iteration_id, Integer |
#not_completed? ⇒ true, false
Returns true if the story is not completed i.e not in :accepted state
88 89 90 |
# File 'lib/trajectory/domain/story.rb', line 88 def not_completed? !completed? end |
#points ⇒ Integer
Returns estimation in points of the story complexity.
32 |
# File 'lib/trajectory/domain/story.rb', line 32 attribute :points, Integer |
#position ⇒ Integer
The Integer position of the story in the backlog. Lower is higher.
15 |
# File 'lib/trajectory/domain/story.rb', line 15 attribute :position, Integer |
#project ⇒ Project
Fetch the project the story belongs to
67 68 69 |
# File 'lib/trajectory/domain/story.rb', line 67 def project @project ||= DataStore.find_project_by_id(project_id) end |
#project_id ⇒ Integer
Returns project id the story belongs to.
50 |
# File 'lib/trajectory/domain/story.rb', line 50 attribute :project_id, Integer |
#started? ⇒ true, false
Returns true if the story is started i.e in :started state
74 75 76 |
# File 'lib/trajectory/domain/story.rb', line 74 def started? state == :started end |
#state ⇒ Symbol
Returns state of the story in [:started, :unstarted, :delivered, :accepted, :rejected].
47 |
# File 'lib/trajectory/domain/story.rb', line 47 attribute :state, Symbol |
#state_events ⇒ Array<Symbol>
Returns the valid states the story can transition to.
19 |
# File 'lib/trajectory/domain/story.rb', line 19 attribute :state_events, Array[Symbol] |
#task_type ⇒ String
Returns the type of story as “Feature”, “Bug”, “Todo” or “Milestone”.
11 |
# File 'lib/trajectory/domain/story.rb', line 11 attribute :task_type, String |
#title ⇒ String
Returns the title of the story.
21 |
# File 'lib/trajectory/domain/story.rb', line 21 attribute :title, String |
#unstarted? ⇒ true, false
Returns true if the story is not started i.e in :unstarted state
81 82 83 |
# File 'lib/trajectory/domain/story.rb', line 81 def unstarted? state == :unstarted end |
#updated_at ⇒ DateTime
Returns the last modification date of the story.
25 |
# File 'lib/trajectory/domain/story.rb', line 25 attribute :updated_at, DateTime |
#user ⇒ User
Fetch the user that created the story
102 103 104 |
# File 'lib/trajectory/domain/story.rb', line 102 def user @user ||= DataStore.find_user_of_project_with_id(project, user_id) end |
#user_id ⇒ Integer
Returns id of the user that created the story.
43 |
# File 'lib/trajectory/domain/story.rb', line 43 attribute :user_id, Integer |
#user_name ⇒ String
Returns name of the user that created the story.
40 |
# File 'lib/trajectory/domain/story.rb', line 40 attribute :user_name, String |