Class: BeamUp::Result
- Inherits:
-
Object
- Object
- BeamUp::Result
- Defined in:
- lib/beam_up/result.rb
Instance Attribute Summary collapse
-
#deploy_id ⇒ Object
readonly
Returns the value of attribute deploy_id.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(provider:, deploy_id: nil, url: nil, error: nil) ⇒ Result
constructor
A new instance of Result.
- #message ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(provider:, deploy_id: nil, url: nil, error: nil) ⇒ Result
Returns a new instance of Result.
7 8 9 10 11 12 |
# File 'lib/beam_up/result.rb', line 7 def initialize(provider:, deploy_id: nil, url: nil, error: nil) @provider = provider @deploy_id = deploy_id @url = url @error = error end |
Instance Attribute Details
#deploy_id ⇒ Object (readonly)
Returns the value of attribute deploy_id.
5 6 7 |
# File 'lib/beam_up/result.rb', line 5 def deploy_id @deploy_id end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
5 6 7 |
# File 'lib/beam_up/result.rb', line 5 def error @error end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
5 6 7 |
# File 'lib/beam_up/result.rb', line 5 def provider @provider end |
Instance Method Details
#failure? ⇒ Boolean
16 |
# File 'lib/beam_up/result.rb', line 16 def failure? = !success? |
#message ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/beam_up/result.rb', line 18 def if success? "Successfully deployed to #{@provider}#{" at #{@url}" if @url}" else "Deployment to #{@provider} failed: #{@error}" end end |
#success? ⇒ Boolean
14 |
# File 'lib/beam_up/result.rb', line 14 def success? = @error.nil? |