Class: BSV::Registry::CertificateDefinitionData

Inherits:
Object
  • Object
show all
Defined in:
lib/bsv/registry/types.rb

Overview

Registry data for a certificate type definition.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, name:, icon_url:, description:, documentation_url:, fields: {}, registry_operator: nil) ⇒ CertificateDefinitionData

Returns a new instance of CertificateDefinitionData.

Parameters:

  • type (String)
  • name (String)
  • icon_url (String)
  • description (String)
  • documentation_url (String)
  • fields (Hash<String, CertificateFieldDescriptor>) (defaults to: {})
  • registry_operator (String, nil) (defaults to: nil)


170
171
172
173
174
175
176
177
178
179
180
# File 'lib/bsv/registry/types.rb', line 170

def initialize(type:, name:, icon_url:, description:, documentation_url:,
               fields: {}, registry_operator: nil)
  @definition_type   = DefinitionType::CERTIFICATE
  @type              = type
  @name              = name
  @icon_url          = icon_url
  @description       = description
  @documentation_url = documentation_url
  @fields            = fields
  @registry_operator = registry_operator
end

Instance Attribute Details

#definition_typeString (readonly)

Returns always DefinitionType::CERTIFICATE.

Returns:

  • (String)

    always DefinitionType::CERTIFICATE



140
141
142
# File 'lib/bsv/registry/types.rb', line 140

def definition_type
  @definition_type
end

#descriptionString (readonly)

Returns description of the certificate type’s purpose.

Returns:

  • (String)

    description of the certificate type’s purpose



152
153
154
# File 'lib/bsv/registry/types.rb', line 152

def description
  @description
end

#documentation_urlString (readonly)

Returns URL to the certificate type documentation.

Returns:

  • (String)

    URL to the certificate type documentation



155
156
157
# File 'lib/bsv/registry/types.rb', line 155

def documentation_url
  @documentation_url
end

#fieldsHash<String, CertificateFieldDescriptor> (readonly)

Returns field schema descriptors.

Returns:



158
159
160
# File 'lib/bsv/registry/types.rb', line 158

def fields
  @fields
end

#icon_urlString (readonly)

Returns URL or opaque string for the certificate type icon.

Returns:

  • (String)

    URL or opaque string for the certificate type icon



149
150
151
# File 'lib/bsv/registry/types.rb', line 149

def icon_url
  @icon_url
end

#nameString (readonly)

Returns human-readable name.

Returns:

  • (String)

    human-readable name



146
147
148
# File 'lib/bsv/registry/types.rb', line 146

def name
  @name
end

#registry_operatorString? (readonly)

Returns public key hex of the registry operator.

Returns:

  • (String, nil)

    public key hex of the registry operator



161
162
163
# File 'lib/bsv/registry/types.rb', line 161

def registry_operator
  @registry_operator
end

#typeString (readonly)

Returns Base64-encoded certificate type identifier.

Returns:

  • (String)

    Base64-encoded certificate type identifier



143
144
145
# File 'lib/bsv/registry/types.rb', line 143

def type
  @type
end