Class: Carson::Delivery
- Inherits:
-
Object
- Object
- Carson::Delivery
- Defined in:
- lib/carson/delivery.rb
Constant Summary collapse
- ACTIVE_STATES =
%w[preparing gated queued integrating escalated].freeze
- BLOCKED_STATES =
%w[gated escalated].freeze
- READY_STATES =
%w[queued].freeze
- TERMINAL_STATES =
%w[integrated failed superseded].freeze
Instance Attribute Summary collapse
-
#authority ⇒ Object
readonly
Returns the value of attribute authority.
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#cause ⇒ Object
readonly
Returns the value of attribute cause.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#head ⇒ Object
readonly
Returns the value of attribute head.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#integrated_at ⇒ Object
readonly
Returns the value of attribute integrated_at.
-
#pull_request_number ⇒ Object
readonly
Returns the value of attribute pull_request_number.
-
#pull_request_url ⇒ Object
readonly
Returns the value of attribute pull_request_url.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#revision_count ⇒ Object
readonly
Returns the value of attribute revision_count.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#superseded_at ⇒ Object
readonly
Returns the value of attribute superseded_at.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#worktree_path ⇒ Object
readonly
Returns the value of attribute worktree_path.
Instance Method Summary collapse
- #active? ⇒ Boolean
- #blocked? ⇒ Boolean
- #failed? ⇒ Boolean
-
#initialize(id:, repository:, branch:, head:, worktree_path:, authority:, status:, pull_request_number:, pull_request_url:, revision_count:, cause:, summary:, created_at:, updated_at:, integrated_at:, superseded_at:) ⇒ Delivery
constructor
A new instance of Delivery.
- #integrated? ⇒ Boolean
- #ready? ⇒ Boolean
- #superseded? ⇒ Boolean
- #terminal? ⇒ Boolean
Constructor Details
#initialize(id:, repository:, branch:, head:, worktree_path:, authority:, status:, pull_request_number:, pull_request_url:, revision_count:, cause:, summary:, created_at:, updated_at:, integrated_at:, superseded_at:) ⇒ Delivery
Returns a new instance of Delivery.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/carson/delivery.rb', line 13 def initialize( id:, repository:, branch:, head:, worktree_path:, authority:, status:, pull_request_number:, pull_request_url:, revision_count:, cause:, summary:, created_at:, updated_at:, integrated_at:, superseded_at: ) @id = id @repository = repository @branch = branch @head = head @worktree_path = worktree_path @authority = @status = status @pull_request_number = pull_request_number @pull_request_url = pull_request_url @revision_count = revision_count @cause = cause @summary = summary @created_at = created_at @updated_at = updated_at @integrated_at = integrated_at @superseded_at = superseded_at end |
Instance Attribute Details
#authority ⇒ Object (readonly)
Returns the value of attribute authority.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def @authority end |
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def branch @branch end |
#cause ⇒ Object (readonly)
Returns the value of attribute cause.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def cause @cause end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def created_at @created_at end |
#head ⇒ Object (readonly)
Returns the value of attribute head.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def head @head end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def id @id end |
#integrated_at ⇒ Object (readonly)
Returns the value of attribute integrated_at.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def integrated_at @integrated_at end |
#pull_request_number ⇒ Object (readonly)
Returns the value of attribute pull_request_number.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def pull_request_number @pull_request_number end |
#pull_request_url ⇒ Object (readonly)
Returns the value of attribute pull_request_url.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def pull_request_url @pull_request_url end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def repository @repository end |
#revision_count ⇒ Object (readonly)
Returns the value of attribute revision_count.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def revision_count @revision_count end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def status @status end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def summary @summary end |
#superseded_at ⇒ Object (readonly)
Returns the value of attribute superseded_at.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def superseded_at @superseded_at end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def updated_at @updated_at end |
#worktree_path ⇒ Object (readonly)
Returns the value of attribute worktree_path.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def worktree_path @worktree_path end |
Instance Method Details
#active? ⇒ Boolean
36 37 38 |
# File 'lib/carson/delivery.rb', line 36 def active? ACTIVE_STATES.include?( status ) end |
#blocked? ⇒ Boolean
40 41 42 |
# File 'lib/carson/delivery.rb', line 40 def blocked? BLOCKED_STATES.include?( status ) end |
#failed? ⇒ Boolean
52 53 54 |
# File 'lib/carson/delivery.rb', line 52 def failed? status == "failed" end |
#integrated? ⇒ Boolean
48 49 50 |
# File 'lib/carson/delivery.rb', line 48 def integrated? status == "integrated" end |
#ready? ⇒ Boolean
44 45 46 |
# File 'lib/carson/delivery.rb', line 44 def ready? READY_STATES.include?( status ) end |
#superseded? ⇒ Boolean
56 57 58 |
# File 'lib/carson/delivery.rb', line 56 def superseded? status == "superseded" end |
#terminal? ⇒ Boolean
60 61 62 |
# File 'lib/carson/delivery.rb', line 60 def terminal? TERMINAL_STATES.include?( status ) end |