Class: Cloudsponge::Event
- Inherits:
-
Object
- Object
- Cloudsponge::Event
- Defined in:
- lib/cloudsponge/event.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#event_type ⇒ Object
Returns the value of attribute event_type.
-
#status ⇒ Object
Returns the value of attribute status.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(event_data) ⇒ Event
constructor
A new instance of Event.
- #inspect ⇒ Object
- #is_complete? ⇒ Boolean
- #is_error? ⇒ Boolean
Constructor Details
#initialize(event_data) ⇒ Event
Returns a new instance of Event.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cloudsponge/event.rb', line 16 def initialize(event_data) # is it an error? # get the basic data self.event_type = event_data['event_type'] self.status = event_data['status'] self.value = event_data['value'] self.description = event_data['description'] self end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/cloudsponge/event.rb', line 6 def description @description end |
#event_type ⇒ Object
Returns the value of attribute event_type.
6 7 8 |
# File 'lib/cloudsponge/event.rb', line 6 def event_type @event_type end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/cloudsponge/event.rb', line 6 def status @status end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/cloudsponge/event.rb', line 6 def value @value end |
Class Method Details
Instance Method Details
#inspect ⇒ Object
12 13 14 |
# File 'lib/cloudsponge/event.rb', line 12 def inspect "\#<#{self.class} #{event_type} #{status} #{value}>" end |
#is_complete? ⇒ Boolean
31 32 33 |
# File 'lib/cloudsponge/event.rb', line 31 def is_complete? self.event_type == 'COMPLETE' && self.status == 'COMPLETED' end |
#is_error? ⇒ Boolean
27 28 29 |
# File 'lib/cloudsponge/event.rb', line 27 def is_error? self.status == 'ERROR' end |