Class: Viewpoint::EWS::SOAP::ResponseMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/ews/soap/response_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ ResponseMessage

Returns a new instance of ResponseMessage



24
25
26
27
# File 'lib/ews/soap/response_message.rb', line 24

def initialize(message)
  @type    = message.keys.first
  @message = message[@type]
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message



22
23
24
# File 'lib/ews/soap/response_message.rb', line 22

def message
  @message
end

#typeObject (readonly)

Returns the value of attribute type



22
23
24
# File 'lib/ews/soap/response_message.rb', line 22

def type
  @type
end

Instance Method Details

#itemsObject



51
52
53
# File 'lib/ews/soap/response_message.rb', line 51

def items
  safe_hash_access(message, [:elems, :items, :elems]) || []
end

#message_textObject



38
39
40
# File 'lib/ews/soap/response_message.rb', line 38

def message_text
  safe_hash_access message, [:elems, :message_text, :text]
end

#message_xmlObject



47
48
49
# File 'lib/ews/soap/response_message.rb', line 47

def message_xml
  safe_hash_access message, [:elems, :message_xml, :text]
end

#response_classObject Also known as: status



29
30
31
# File 'lib/ews/soap/response_message.rb', line 29

def response_class
  message[:attribs][:response_class]
end

#response_codeObject Also known as: code



42
43
44
# File 'lib/ews/soap/response_message.rb', line 42

def response_code
  safe_hash_access message, [:elems, :response_code, :text]
end

#success?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/ews/soap/response_message.rb', line 34

def success?
  response_class == 'Success'
end