class Octaccord::Iteration

Attributes

due[RW]
manager[RW]
name[RW]
repository[RW]
start[RW]

Public Class Methods

new(client: client, name: name, manager: manager, start: start, due: due, team: team, repository: repository) click to toggle source
# File lib/octaccord/iteration.rb, line 7
def initialize(client: client, name: name, manager: manager, start: start, due: due, team: team, repository: repository)
  if /([^\d]+)(\d+)/ =~ name
    @prefix, @number = $1, $2.to_i
  end
  @manager   = manager
  @team      = team
  @repository = repository
  @client = client
  self.start = start
  self.due   = due
end

Public Instance Methods

due=(time) click to toggle source
# File lib/octaccord/iteration.rb, line 33
def due=(time)
  @due   = Time.parse(time.to_s)
end
members() click to toggle source
# File lib/octaccord/iteration.rb, line 19
def members
  org, team_name = @team.split('/')
  team_id = @client.organization_teams(org).select{|t| t.name == team_name}.first.id
  @client.team_members(team_id).map(&:login)
end
next() click to toggle source
# File lib/octaccord/iteration.rb, line 57
def next
  self.class.new(name: name(+1), manager: @manager, start: @start, due: @due)
end
prev() click to toggle source
# File lib/octaccord/iteration.rb, line 53
def prev
  self.class.new(name: name(-1), manager: @manager, start: @start, due: @due)
end
start=(time) click to toggle source
# File lib/octaccord/iteration.rb, line 29
def start=(time)
  @start = Time.parse(time.to_s)
end