Class: Insika::TokenStore::Record

Inherits:
Data
  • Object
show all
Defined in:
lib/insika/token_store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



24
25
26
# File 'lib/insika/token_store.rb', line 24

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



24
25
26
# File 'lib/insika/token_store.rb', line 24

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



24
25
26
# File 'lib/insika/token_store.rb', line 24

def label
  @label
end

#revoked_atObject (readonly)

Returns the value of attribute revoked_at

Returns:

  • (Object)

    the current value of revoked_at



24
25
26
# File 'lib/insika/token_store.rb', line 24

def revoked_at
  @revoked_at
end

#roleObject (readonly)

Returns the value of attribute role

Returns:

  • (Object)

    the current value of role



24
25
26
# File 'lib/insika/token_store.rb', line 24

def role
  @role
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



24
25
26
# File 'lib/insika/token_store.rb', line 24

def status
  @status
end

#tenant_idObject (readonly)

Returns the value of attribute tenant_id

Returns:

  • (Object)

    the current value of tenant_id



24
25
26
# File 'lib/insika/token_store.rb', line 24

def tenant_id
  @tenant_id
end

#token_hashObject (readonly)

Returns the value of attribute token_hash

Returns:

  • (Object)

    the current value of token_hash



24
25
26
# File 'lib/insika/token_store.rb', line 24

def token_hash
  @token_hash
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


26
# File 'lib/insika/token_store.rb', line 26

def active? = status.to_s == "active"

#tenant?Boolean

Returns:

  • (Boolean)


27
# File 'lib/insika/token_store.rb', line 27

def tenant? = role.to_s == "tenant"

#to_hObject



28
29
30
31
# File 'lib/insika/token_store.rb', line 28

def to_h
  { id: id, role: role, tenant_id: tenant_id, label: label,
    status: status, created_at: created_at, revoked_at: revoked_at }
end