Class: Trajectory::Idea
- Inherits:
-
Object
- Object
- Trajectory::Idea
- Includes:
- Virtus
- Defined in:
- lib/trajectory/domain/idea.rb
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Returns true if two ideas are the sames i.e they share the same id attribute.
-
#body ⇒ String
The content of the idea.
-
#comments_count ⇒ Integer
The number of comments on the idea.
-
#editable_by_current_user? ⇒ true, false
True if the user can edit the idea, false otherwise.
-
#id ⇒ Integer
The unique identifier of the idea.
-
#last_activity_at ⇒ DateTime
Date of the last activity (i.e edit, comment, …) on the idea.
-
#last_comment_created_at ⇒ DateTime
Date of the last comment on the idea.
-
#last_comment_user_name ⇒ String
Name of the last user that have commented on the idea.
- #percent_complete ⇒ Object
-
#project ⇒ Project
Fetch the project the idea belongs to.
-
#project_id ⇒ Integer
The id of the project the idea belongs to.
- #stories ⇒ Object
-
#stories_count ⇒ Integer
The number of stories associated with the idea.
-
#subject ⇒ String
The subject (i.e title) of the idea.
-
#subscribed_user_ids ⇒ Array<Integer>
The ids of the users that have subscribed to the.
- #subscribed_users ⇒ Object
-
#user ⇒ User
Fetch the user that created the idea.
-
#user_id ⇒ Integer
Idea of the user that created the idea.
Instance Method Details
#==(other) ⇒ true, false
Returns true if two ideas are the sames i.e they share the same id attribute
40 41 42 |
# File 'lib/trajectory/domain/idea.rb', line 40 def ==(other) id == other.id end |
#body ⇒ String
Returns the content of the idea.
33 |
# File 'lib/trajectory/domain/idea.rb', line 33 attribute :body, String |
#comments_count ⇒ Integer
Returns the number of comments on the idea.
13 |
# File 'lib/trajectory/domain/idea.rb', line 13 attribute :comments_count, Integer |
#editable_by_current_user? ⇒ true, false
Returns true if the user can edit the idea, false otherwise.
22 |
# File 'lib/trajectory/domain/idea.rb', line 22 attribute :editable_by_current_user, Boolean |
#id ⇒ Integer
Returns the unique identifier of the idea.
7 |
# File 'lib/trajectory/domain/idea.rb', line 7 attribute :id, Integer, default: lambda { |project, attribute| raise MissingAttributeError.new(project, :id) } |
#last_activity_at ⇒ DateTime
Returns date of the last activity (i.e edit, comment, …) on the idea.
19 |
# File 'lib/trajectory/domain/idea.rb', line 19 attribute :last_activity_at, DateTime |
#last_comment_created_at ⇒ DateTime
Returns date of the last comment on the idea.
17 |
# File 'lib/trajectory/domain/idea.rb', line 17 attribute :last_comment_created_at, DateTime |
#last_comment_user_name ⇒ String
Returns Name of the last user that have commented on the idea.
15 |
# File 'lib/trajectory/domain/idea.rb', line 15 attribute :last_comment_user_name, String |
#percent_complete ⇒ Object
63 64 |
# File 'lib/trajectory/domain/idea.rb', line 63 def percent_complete end |
#project ⇒ Project
Fetch the project the idea belongs to
47 48 49 |
# File 'lib/trajectory/domain/idea.rb', line 47 def project DataStore.find_project_by_id(project_id) end |
#project_id ⇒ Integer
Returns the id of the project the idea belongs to.
31 |
# File 'lib/trajectory/domain/idea.rb', line 31 attribute :project_id, Integer |
#stories ⇒ Object
67 68 |
# File 'lib/trajectory/domain/idea.rb', line 67 def stories end |
#stories_count ⇒ Integer
Returns the number of stories associated with the idea.
11 |
# File 'lib/trajectory/domain/idea.rb', line 11 attribute :stories_count, Integer |
#subject ⇒ String
Returns the subject (i.e title) of the idea.
9 |
# File 'lib/trajectory/domain/idea.rb', line 9 attribute :subject, String |
#subscribed_user_ids ⇒ Array<Integer>
Returns the ids of the users that have subscribed to the.
28 |
# File 'lib/trajectory/domain/idea.rb', line 28 attribute :subscribed_user_ids, Array[Integer] |
#subscribed_users ⇒ Object
59 60 |
# File 'lib/trajectory/domain/idea.rb', line 59 def subscribed_users end |
#user ⇒ User
Fetch the user that created the idea
54 55 56 |
# File 'lib/trajectory/domain/idea.rb', line 54 def user DataStore.find_user_of_project_with_id(project, user_id) end |
#user_id ⇒ Integer
Returns idea of the user that created the idea.
25 |
# File 'lib/trajectory/domain/idea.rb', line 25 attribute :user_id, Integer |