Sha256: 527481439b678836d62e09fbc71daf0a5b943c2574b36114f17d17de6cb33e86

Contents?: true

Size: 764 Bytes

Versions: 14

Compression:

Stored size: 764 Bytes

Contents

class TicketAntecedent
  include Comparable

  def initialize(ticket_or_commit, kind, id)
    @ticket_or_commit = ticket_or_commit
    @kind = kind
    @id = id
  end

  attr_reader :ticket_or_commit, :kind, :id
  delegate :project, to: :ticket_or_commit

  def self.from_s(ticket, string)
    new ticket, *string.split(":")
  end

  def to_s
    "#{kind}:#{id}"
  end

  def <=>(other)
    [kind, id] <=> [other.kind, other.id]
  end



  def released!(release=nil)
    Houston.observer.fire "antecedent:#{kind.downcase.underscore}:released", self
  end

  def resolve!
    Houston.observer.fire "antecedent:#{kind.downcase.underscore}:resolved", self
  end

  def close!
    Houston.observer.fire "antecedent:#{kind.downcase.underscore}:closed", self
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
houston-core-0.7.0.beta3 app/models/ticket_antecedent.rb
houston-core-0.7.0.beta2 app/models/ticket_antecedent.rb
houston-core-0.7.0.beta app/models/ticket_antecedent.rb
houston-core-0.6.3 app/models/ticket_antecedent.rb
houston-core-0.6.2 app/models/ticket_antecedent.rb
houston-core-0.6.1 app/models/ticket_antecedent.rb
houston-core-0.6.0 app/models/ticket_antecedent.rb
houston-core-0.5.6 app/models/ticket_antecedent.rb
houston-core-0.5.5 app/models/ticket_antecedent.rb
houston-core-0.5.4 app/models/ticket_antecedent.rb
houston-core-0.5.3 app/models/ticket_antecedent.rb
houston-core-0.5.2 app/models/ticket_antecedent.rb
houston-core-0.5.1 app/models/ticket_antecedent.rb
houston-core-0.5.0 app/models/ticket_antecedent.rb