Class: Trajectory::Idea

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

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ true, false

Returns true if two ideas are the sames i.e they share the same id attribute

Parameters:

  • other (Idea)

    the other object to compare

Returns:

  • (true, false)


40
41
42
# File 'lib/trajectory/domain/idea.rb', line 40

def ==(other)
  id == other.id
end

#bodyString

Returns the content of the idea.

Returns:

  • (String)

    the content of the idea



33
# File 'lib/trajectory/domain/idea.rb', line 33

attribute :body, String

#comments_countInteger

Returns the number of comments on the idea.

Returns:

  • (Integer)

    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.

Returns:

  • (true, false)

    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

#idInteger

Returns the unique identifier of the idea.

Returns:

  • (Integer)

    the unique identifier of the idea.

Raises:



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

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

#last_activity_atDateTime

Returns date of the last activity (i.e edit, comment, …) on the idea.

Returns:

  • (DateTime)

    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_atDateTime

Returns date of the last comment on the idea.

Returns:

  • (DateTime)

    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_nameString

Returns Name of the last user that have commented on the idea.

Returns:

  • (String)

    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_completeObject



63
64
# File 'lib/trajectory/domain/idea.rb', line 63

def percent_complete
end

#projectProject

Fetch the project the idea belongs to

Returns:



47
48
49
# File 'lib/trajectory/domain/idea.rb', line 47

def project
  DataStore.find_project_by_id(project_id)
end

#project_idInteger

Returns the id of the project the idea belongs to.

Returns:

  • (Integer)

    the id of the project the idea belongs to

See Also:



31
# File 'lib/trajectory/domain/idea.rb', line 31

attribute :project_id, Integer

#storiesObject



67
68
# File 'lib/trajectory/domain/idea.rb', line 67

def stories
end

#stories_countInteger

Returns the number of stories associated with the idea.

Returns:

  • (Integer)

    the number of stories associated with the idea



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

attribute :stories_count, Integer

#subjectString

Returns the subject (i.e title) of the idea.

Returns:

  • (String)

    the subject (i.e title) of the idea



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

attribute :subject, String

#subscribed_user_idsArray<Integer>

Returns the ids of the users that have subscribed to the.

Returns:

  • (Array<Integer>)

    the ids of the users that have subscribed to the

See Also:



28
# File 'lib/trajectory/domain/idea.rb', line 28

attribute :subscribed_user_ids, Array[Integer]

#subscribed_usersObject



59
60
# File 'lib/trajectory/domain/idea.rb', line 59

def subscribed_users
end

#userUser

Fetch the user that created the idea

Returns:



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_idInteger

Returns idea of the user that created the idea.

Returns:

  • (Integer)

    idea of the user that created the idea

See Also:



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

attribute :user_id, Integer