Sha256: 0abd0bbae78429a39e6cc0c420e7ba70d52e4fa392c8a56fdc62509dc32e9b19

Contents?: true

Size: 413 Bytes

Versions: 18

Compression:

Stored size: 413 Bytes

Contents

class Ey::Core::Client::Token < Ey::Core::Model

  identity :auth_id

  attribute :on_behalf_of

  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

end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
ey-core-3.0.2 lib/ey-core/models/token.rb
ey-core-3.0.1 lib/ey-core/models/token.rb
ey-core-3.0.0 lib/ey-core/models/token.rb
ey-pro-cli-0.0.17 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.16 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.15 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.14 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.13 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.12 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.11 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.10 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.9 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.8 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.7 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.6 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.5 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.4 lib/vendor/core/ey-core/models/token.rb
ey-pro-cli-0.0.3 lib/vendor/core/ey-core/models/token.rb