Sha256: d4ec49182eb92ee8cc68622838bd378706efe47715f1ad88469dd5c4f4785e1b

Contents?: true

Size: 570 Bytes

Versions: 3

Compression:

Stored size: 570 Bytes

Contents

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

  identity :id

  attribute :auth_id
  attribute :on_behalf_of
  attribute :last_seen_at, type: :time
  attribute :expires_at,   type: :time
  attribute :revoked_at,   type: :time

  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

3 entries across 3 versions & 1 rubygems

Version Path
ey-core-3.6.6 lib/ey-core/models/token.rb
ey-core-3.4.5 lib/ey-core/models/token.rb
ey-core-3.6.5 lib/ey-core/models/token.rb