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