Class: Dox::Api::Auth::Authorization

Inherits:
Object
  • Object
show all
Includes:
ResourceModel
Defined in:
lib/dox/api/auth/authorization.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ResourceModel

#attributes, #attributes=, #errors_from_json, #from_json, #href, #initialize, #to_json

Instance Attribute Details

#appObject

Returns the value of attribute app


8
9
10
# File 'lib/dox/api/auth/authorization.rb', line 8

def app
  @app
end

#userObject

Returns the value of attribute user


8
9
10
# File 'lib/dox/api/auth/authorization.rb', line 8

def user
  @user
end

Instance Method Details

#locationObject


10
11
12
13
14
15
16
17
18
# File 'lib/dox/api/auth/authorization.rb', line 10

def location
  url = if user_id
    "/apps/{app_id}/users/{user_id}/authorization"
  else
    "/apps/{app_id}/authorization"
  end

  { href: url, singleton: true }
end