class KaveRestApi::ResponseTts

Attributes

response[R]
status[R]
statustext[R]

Public Instance Methods

entries(select=nil) click to toggle source
# File lib/kave_rest_api/responds/tts.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/tts.rb, line 25
def full_message_errors
  return KaveRestApi::ERRORS[@response['return']['message'].to_s]
end
valid?() click to toggle source
# File lib/kave_rest_api/responds/tts.rb, line 11
def valid?
  @valid
end
validate(response = nil) click to toggle source
# File lib/kave_rest_api/responds/tts.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/tts.rb, line 31
def perform_validation
  raise ArgumentError, 'not a valid response' if @response.nil?
  @valid = (@response['return']['status'] == 200)
end