Class: FlixCloud::Notification
- Defined in:
- lib/flix_cloud/notification.rb
Instance Attribute Summary collapse
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#finished_job_at ⇒ Object
Returns the value of attribute finished_job_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#initialized_job_at ⇒ Object
Returns the value of attribute initialized_job_at.
-
#recipe_id ⇒ Object
Returns the value of attribute recipe_id.
-
#recipe_name ⇒ Object
Returns the value of attribute recipe_name.
-
#state ⇒ Object
Returns the value of attribute state.
-
#xml ⇒ Object
Returns the value of attribute xml.
Attributes inherited from Record
Instance Method Summary collapse
- #cancelled? ⇒ Boolean
- #failed? ⇒ Boolean
-
#initialize(attrs = {}) ⇒ Notification
constructor
A new instance of Notification.
- #successful? ⇒ Boolean
Methods inherited from Record
Constructor Details
#initialize(attrs = {}) ⇒ Notification
Returns a new instance of Notification.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/flix_cloud/notification.rb', line 9 def initialize(attrs={}) if attrs.is_a?(String) self.xml = attrs attrs = Crack::XML.parse(attrs) end attrs = attrs['job'] if attrs['job'] super(attrs) end |
Instance Attribute Details
#error_message ⇒ Object
Returns the value of attribute error_message.
2 3 4 |
# File 'lib/flix_cloud/notification.rb', line 2 def @error_message end |
#finished_job_at ⇒ Object
Returns the value of attribute finished_job_at.
2 3 4 |
# File 'lib/flix_cloud/notification.rb', line 2 def finished_job_at @finished_job_at end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/flix_cloud/notification.rb', line 2 def id @id end |
#initialized_job_at ⇒ Object
Returns the value of attribute initialized_job_at.
2 3 4 |
# File 'lib/flix_cloud/notification.rb', line 2 def initialized_job_at @initialized_job_at end |
#recipe_id ⇒ Object
Returns the value of attribute recipe_id.
2 3 4 |
# File 'lib/flix_cloud/notification.rb', line 2 def recipe_id @recipe_id end |
#recipe_name ⇒ Object
Returns the value of attribute recipe_name.
2 3 4 |
# File 'lib/flix_cloud/notification.rb', line 2 def recipe_name @recipe_name end |
#state ⇒ Object
Returns the value of attribute state.
2 3 4 |
# File 'lib/flix_cloud/notification.rb', line 2 def state @state end |
#xml ⇒ Object
Returns the value of attribute xml.
2 3 4 |
# File 'lib/flix_cloud/notification.rb', line 2 def xml @xml end |
Instance Method Details
#cancelled? ⇒ Boolean
28 29 30 |
# File 'lib/flix_cloud/notification.rb', line 28 def cancelled? state == 'cancelled_job' end |
#failed? ⇒ Boolean
24 25 26 |
# File 'lib/flix_cloud/notification.rb', line 24 def failed? state == 'failed_job' end |
#successful? ⇒ Boolean
20 21 22 |
# File 'lib/flix_cloud/notification.rb', line 20 def successful? state == 'successful_job' end |