Method: DocuSign_Maestro::OAuth::OAuthToken#initialize

Defined in:
lib/docusign_maestro/client/auth/oauth.rb

#initialize(attributes = {}) ⇒ OAuthToken

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

[View source]

459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/docusign_maestro/client/auth/oauth.rb', line 459

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'accessToken')
    self.access_token = attributes[:'accessToken']
  end

  if attributes.has_key?(:'scope')
    self.scope = attributes[:'scope']
  end

  if attributes.has_key?(:'refreshToken')
    self.refresh_token = attributes[:'refreshToken']
  end

  if attributes.has_key?(:'expiresIn')
    self.expires_in = attributes[:'expiresIn']
  end

  if attributes.has_key?(:'tokenType')
    self.token_type = attributes[:'tokenType']
  end

  if attributes.has_key?(:'data')
    if (value = attributes[:'data']).is_a?(Array)
      self.data = value
    end
  end
end