Class: Ace::Task::Models::Task

Inherits:
Struct
  • Object
show all
Defined in:
lib/ace/task/models/task.rb

Overview

Value object representing a task.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def content
  @content
end

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def created_at
  @created_at
end

#dependenciesObject

Returns the value of attribute dependencies

Returns:

  • (Object)

    the current value of dependencies



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def dependencies
  @dependencies
end

#estimateObject

Returns the value of attribute estimate

Returns:

  • (Object)

    the current value of estimate



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def estimate
  @estimate
end

#file_pathObject

Returns the value of attribute file_path

Returns:

  • (Object)

    the current value of file_path



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def file_path
  @file_path
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def id
  @id
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def 
  @metadata
end

#parent_idObject

Returns the value of attribute parent_id

Returns:

  • (Object)

    the current value of parent_id



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def parent_id
  @parent_id
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def path
  @path
end

#priorityObject

Returns the value of attribute priority

Returns:

  • (Object)

    the current value of priority



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def priority
  @priority
end

#special_folderObject

Returns the value of attribute special_folder

Returns:

  • (Object)

    the current value of special_folder



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def special_folder
  @special_folder
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def status
  @status
end

#subtasksObject

Returns the value of attribute subtasks

Returns:

  • (Object)

    the current value of subtasks



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def subtasks
  @subtasks
end

#tagsObject

Returns the value of attribute tags

Returns:

  • (Object)

    the current value of tags



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def tags
  @tags
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



7
8
9
# File 'lib/ace/task/models/task.rb', line 7

def title
  @title
end

Instance Method Details

#has_subtasks?Boolean

Whether this task has subtasks

Returns:

  • (Boolean)


36
37
38
# File 'lib/ace/task/models/task.rb', line 36

def has_subtasks?
  subtasks && !subtasks.empty?
end

#shortcutObject

Last 3 characters of the ID (shortcut for resolution)



26
27
28
# File 'lib/ace/task/models/task.rb', line 26

def shortcut
  id[-3..] if id
end

#subtask?Boolean

Whether this task is a subtask (has a parent)

Returns:

  • (Boolean)


31
32
33
# File 'lib/ace/task/models/task.rb', line 31

def subtask?
  !parent_id.nil?
end

#to_sObject



40
41
42
# File 'lib/ace/task/models/task.rb', line 40

def to_s
  "Task(#{id}: #{title})"
end