class KaveRestApi::ResponseSendSimple
Attributes
response[R]
status[R]
statusmessage[R]
Public Instance Methods
entries(select=nil)
click to toggle source
# File lib/kave_rest_api/responds/send.rb, line 15 def entries(select=nil) if select.nil? return @response['entries'] else return @response['entries'].select { |entry| entry['status'] == (KaveRestApi::ENTRIES[select].nil? ? select:KaveRestApi::ENTRIES[select]) } end end
full_message_errors()
click to toggle source
# File lib/kave_rest_api/responds/send.rb, line 25 def full_message_errors return KaveRestApi::ERRORS[@response['return']['status'].to_s] end
valid?()
click to toggle source
# File lib/kave_rest_api/responds/send.rb, line 11 def valid? @valid end
validate(response = nil)
click to toggle source
# File lib/kave_rest_api/responds/send.rb, line 5 def validate(response = nil) @response = response perform_validation return self end
Private Instance Methods
perform_validation()
click to toggle source
# File lib/kave_rest_api/responds/send.rb, line 31 def perform_validation raise ArgumentError, 'not a valid response' if @response.nil? @valid = (@response['return']['status'] == 200) end