Class: Round::DeviceCollection

Inherits:
Base
  • Object
show all
Defined in:
lib/round/device.rb

Instance Attribute Summary

Attributes inherited from Base

#resource

Instance Method Summary collapse

Methods inherited from Base

association, hash_identifier, #hash_identifier, #initialize, #method_missing, #refresh

Constructor Details

This class inherits a constructor from Round::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Round::Base

Instance Method Details

#create(name, redirect_uri: nil) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/round/device.rb', line 8

def create(name, redirect_uri: nil)
  params = { name: name }
  params[:redirect_uri] = redirect_uri if redirect_uri
  auth_request_resource = @resource.create(params)
  device_token = auth_request_resource..device_token
  mfa_uri = auth_request_resource.mfa_uri
  [device_token, mfa_uri]
end