Class: EROI::Response::Get

Inherits:
Base
  • Object
show all
Defined in:
lib/eroi/response.rb

Instance Attribute Summary

Attributes inherited from Base

#data

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from EROI::Response::Base

Instance Method Details

#contactObject Also known as: contacts



18
19
20
# File 'lib/eroi/response.rb', line 18

def contact
  @data['Retrieve']['Record']
end

#error_messageObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/eroi/response.rb', line 24

def error_message
  case @data['ErrorCode'].to_i
  when 1
    'Invalid username/password was provided.'
  when 2
    'Invalid mailing list was provided.'
  when 3
    'Invalid edition was provided.'
  end
end

#success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/eroi/response.rb', line 14

def success?
  (@data['ErrorCode'] || @data['xml']) ? false : true
end