Class: Ey::Core::Client::Token

Inherits:
Model
  • Object
show all
Defined in:
lib/vendor/core/ey-core/models/token.rb

Instance Method Summary collapse

Methods inherited from Model

#destroy, range_parser, #save, #update!, #url

Instance Method Details

#save!Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/vendor/core/ey-core/models/token.rb', line 7

def save!
  params = {
    "on_behalf_of" => {
      "id"   => self.on_behalf_of.id,
      "type" => self.on_behalf_of.class.api_name,
    }
  }
  if new_record?
    merge_attributes(self.connection.create_token(params).body["token"])
  else raise NotImplementedError # update
  end
end