Class: CXML::Status
- Inherits:
-
DocumentNode
- Object
- DocumentNode
- CXML::Status
- Defined in:
- lib/cxml/status.rb
Instance Attribute Summary
Attributes inherited from DocumentNode
Instance Method Summary collapse
- #code ⇒ Object
-
#failure? ⇒ Boolean
Check if status is failure.
-
#success? ⇒ Boolean
Check if status is success.
Methods inherited from DocumentNode
accessible_attributes, accessible_nodes, attributes, #initialize, #node_name, nodes, #serializable_hash, #to_element
Constructor Details
This class inherits a constructor from CXML::DocumentNode
Instance Method Details
#code ⇒ Object
11 12 13 |
# File 'lib/cxml/status.rb', line 11 def code @code&.to_i end |
#failure? ⇒ Boolean
Check if status is failure
23 24 25 |
# File 'lib/cxml/status.rb', line 23 def failure? !success? end |
#success? ⇒ Boolean
Check if status is success
17 18 19 |
# File 'lib/cxml/status.rb', line 17 def success? [200, 201, 204, 280, 281].include?(code) end |