class TimeTrello::ActivityRecord

Public: An activity record identifies completely an activity done in trello. Its main ideia is to be a standard record that can be compared, sorted and collected, used for reporting purposes.

Attributes

card_name[RW]

Public: Card Name

duration[RW]

Public: Task duration

id[RW]

Public: This activity id. This is, actually, Trello's Action Identification.

owner[RW]

Public: Task owner

project[RW]

Public: Project name (i.e., Trello board)

start_date[RW]

Public: Task start date

task_description[RW]

Public: Task comment

Public Class Methods

new(*args) click to toggle source

Public: Initializes this class with proper information about a given task

project - Project name (i.e., the board name) owner - Name of the duration owner start_date - When the task started duration - The task duration

# File lib/time_trello/activity_record.rb, line 40
def initialize(*args)
  if args.size != 0
    @id                = args[0]
    @duration          = args[1]
    @owner             = args[2]
    @project           = args[3]
    @start_date        = args[4]
    @task_description  = args[5]
    @card_name         = args[6]
  end
end

Public Instance Methods

<=>(other) click to toggle source

Public: Implementation of Comparable mixin. The comparison is done following this attributes hierarchy:

other - The other instance of ActivityRecord to compare with.

# File lib/time_trello/activity_record.rb, line 59
def <=>(other)
  if other == nil
    return -1
  end
  result = @project <=> other.project
  result = @owner <=> other.owner if result == 0
  result = @start_date <=> other.start_date if result == 0
  
  result
end