Class: Authy::User

Inherits:
Response show all
Defined in:
lib/authy/models/user.rb

Instance Attribute Summary

Attributes inherited from Response

#raw_response

Instance Method Summary collapse

Methods inherited from Response

#body, #code, #error_msg, #initialize, #ok?

Methods inherited from Hash

try_convert

Constructor Details

This class inherits a constructor from Authy::Response

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Authy::Response

Instance Method Details

#errorsObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/authy/models/user.rb', line 7

def errors
  case
  when self.ok?
    {}
  when !@errors.empty?
    @errors
  else
    {"error" => error_msg}
  end
end

#idObject



3
4
5
# File 'lib/authy/models/user.rb', line 3

def id
  self['id']
end