Class: Codestatus::BuildStatus
- Inherits:
-
Object
- Object
- Codestatus::BuildStatus
- Defined in:
- lib/codestatus/build_status.rb
Constant Summary collapse
- UNDEFINED =
'undefined'.freeze
- ERROR =
Defined in GitHub
'error'.freeze
- FAILURE =
'failure'.freeze
- PENDING =
'pending'.freeze
- SUCCESS =
'success'.freeze
- STATUSES =
Statuses defined in Bitbucket are mapped into GitHub’s status
STOPPED => ERROR FAILED => FAILURE INPROGRESS => PENDING SUCCESSFUL => SUCCESS [ ERROR, FAILURE, PENDING, SUCCESS, ].freeze
Instance Attribute Summary collapse
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(sha:, status:) ⇒ BuildStatus
constructor
A new instance of BuildStatus.
Constructor Details
#initialize(sha:, status:) ⇒ BuildStatus
Returns a new instance of BuildStatus.
24 25 26 27 28 29 30 31 32 |
# File 'lib/codestatus/build_status.rb', line 24 def initialize(sha:, status:) @sha = sha if STATUSES.include?(status.to_s) @status = status.to_s else @status = UNDEFINED end end |
Instance Attribute Details
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
34 35 36 |
# File 'lib/codestatus/build_status.rb', line 34 def sha @sha end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
34 35 36 |
# File 'lib/codestatus/build_status.rb', line 34 def status @status end |