Sha256: ef6e50f7ba43ca4cf98bd4ab8bf16c517b750dbd86256f4a86932930396e114b
Contents?: true
Size: 555 Bytes
Versions: 8
Compression:
Stored size: 555 Bytes
Contents
require 'virtus' module SearchKit module Models class Key include Virtus.model attribute :id, String attribute :name, String attribute :privilege, String attribute :token, String attribute :uri, String def initialize(key_data = {}) attributes = key_data.fetch(:attributes, {}) uri = key_data.fetch(:links, {}).fetch(:self, '') super(attributes.merge(uri: uri)) end def creator? privilege == 'creator' end end end end
Version data entries
8 entries across 8 versions & 1 rubygems