Class: Trajectory::Story

Inherits:
Object
  • Object
show all
Includes:
Virtus
Defined in:
lib/trajectory/domain/story.rb

Instance Method Summary collapse

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



30
# File 'lib/trajectory/domain/story.rb', line 30

attribute :archived, Boolean

#assignee_nameString



9
# File 'lib/trajectory/domain/story.rb', line 9

attribute :assignee_name, String

#comments_countInteger



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_atDateTime



17
# File 'lib/trajectory/domain/story.rb', line 17

attribute :created_at, DateTime

#deleted?ture, false



38
# File 'lib/trajectory/domain/story.rb', line 38

attribute :deleted, Boolean

#design_neededtrue, false



23
# File 'lib/trajectory/domain/story.rb', line 23

attribute :design_needed, Boolean

#development_needed?true, false



35
# File 'lib/trajectory/domain/story.rb', line 35

attribute :development_needed, Boolean

#idInteger

Returns the unique identifier of the story.

Raises:

  • if id is nil



7
# File 'lib/trajectory/domain/story.rb', line 7

attribute :id, Integer, default: lambda { |project, attribute| raise MissingAttributeError.new(project, :id) }

#idea_subjectString



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

#iterationIteration, 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_idInteger

Returns iteration id the story belongs to.

See Also:



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

#pointsInteger



32
# File 'lib/trajectory/domain/story.rb', line 32

attribute :points, Integer

#positionInteger

The Integer position of the story in the backlog. Lower is higher.



15
# File 'lib/trajectory/domain/story.rb', line 15

attribute :position, Integer

#projectProject

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_idInteger

Returns project id the story belongs to.

See Also:



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

#stateSymbol



47
# File 'lib/trajectory/domain/story.rb', line 47

attribute :state, Symbol

#state_eventsArray<Symbol>



19
# File 'lib/trajectory/domain/story.rb', line 19

attribute :state_events, Array[Symbol]

#task_typeString



11
# File 'lib/trajectory/domain/story.rb', line 11

attribute :task_type, String

#titleString



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_atDateTime



25
# File 'lib/trajectory/domain/story.rb', line 25

attribute :updated_at, DateTime

#userUser

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_idInteger

Returns id of the user that created the story.

See Also:



43
# File 'lib/trajectory/domain/story.rb', line 43

attribute :user_id, Integer

#user_nameString



40
# File 'lib/trajectory/domain/story.rb', line 40

attribute :user_name, String