Class: TicketAntecedent
- Inherits:
-
Object
- Object
- TicketAntecedent
- Includes:
- Comparable
- Defined in:
- app/models/ticket_antecedent.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#ticket_or_commit ⇒ Object
readonly
Returns the value of attribute ticket_or_commit.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #close! ⇒ Object
-
#initialize(ticket_or_commit, kind, id) ⇒ TicketAntecedent
constructor
A new instance of TicketAntecedent.
- #released!(release = nil) ⇒ Object
- #resolve! ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(ticket_or_commit, kind, id) ⇒ TicketAntecedent
Returns a new instance of TicketAntecedent.
4 5 6 7 8 |
# File 'app/models/ticket_antecedent.rb', line 4 def initialize(ticket_or_commit, kind, id) @ticket_or_commit = ticket_or_commit @kind = kind @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'app/models/ticket_antecedent.rb', line 10 def id @id end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
10 11 12 |
# File 'app/models/ticket_antecedent.rb', line 10 def kind @kind end |
#ticket_or_commit ⇒ Object (readonly)
Returns the value of attribute ticket_or_commit.
10 11 12 |
# File 'app/models/ticket_antecedent.rb', line 10 def ticket_or_commit @ticket_or_commit end |
Class Method Details
.from_s(ticket, string) ⇒ Object
13 14 15 |
# File 'app/models/ticket_antecedent.rb', line 13 def self.from_s(ticket, string) new ticket, *string.split(":") end |
Instance Method Details
#<=>(other) ⇒ Object
21 22 23 |
# File 'app/models/ticket_antecedent.rb', line 21 def <=>(other) [kind, id] <=> [other.kind, other.id] end |
#close! ⇒ Object
35 36 37 |
# File 'app/models/ticket_antecedent.rb', line 35 def close! Houston.observer.fire "antecedent:#{kind.downcase.underscore}:closed", self end |
#released!(release = nil) ⇒ Object
27 28 29 |
# File 'app/models/ticket_antecedent.rb', line 27 def released!(release=nil) Houston.observer.fire "antecedent:#{kind.downcase.underscore}:released", self end |
#resolve! ⇒ Object
31 32 33 |
# File 'app/models/ticket_antecedent.rb', line 31 def resolve! Houston.observer.fire "antecedent:#{kind.downcase.underscore}:resolved", self end |
#to_s ⇒ Object
17 18 19 |
# File 'app/models/ticket_antecedent.rb', line 17 def to_s "#{kind}:#{id}" end |