Class: CXML::Status

Inherits:
DocumentNode show all
Defined in:
lib/cxml/status.rb

Instance Attribute Summary

Attributes inherited from DocumentNode

#content

Instance Method Summary collapse

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

#codeObject



11
12
13
# File 'lib/cxml/status.rb', line 11

def code
  @code&.to_i
end

#failure?Boolean

Check if status is failure

Returns:

  • (Boolean)


23
24
25
# File 'lib/cxml/status.rb', line 23

def failure?
  !success?
end

#success?Boolean

Check if status is success

Returns:

  • (Boolean)


17
18
19
# File 'lib/cxml/status.rb', line 17

def success?
  [200, 201, 204, 280, 281].include?(code)
end