Class: BSV::Registry::ProtocolDefinitionData

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

Overview

Registry data for a protocol definition.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(protocol_id:, name:, icon_url:, description:, documentation_url:, registry_operator: nil) ⇒ ProtocolDefinitionData

Returns a new instance of ProtocolDefinitionData.

Parameters:

  • protocol_id (Array)

    two-element [security_level, protocol_name]

  • name (String)
  • icon_url (String)
  • description (String)
  • documentation_url (String)
  • registry_operator (String, nil) (defaults to: nil)


125
126
127
128
129
130
131
132
133
134
# File 'lib/bsv/registry/types.rb', line 125

def initialize(protocol_id:, name:, icon_url:, description:, documentation_url:,
               registry_operator: nil)
  @definition_type   = DefinitionType::PROTOCOL
  @protocol_id       = protocol_id
  @name              = name
  @icon_url          = icon_url
  @description       = description
  @documentation_url = documentation_url
  @registry_operator = registry_operator
end

Instance Attribute Details

#definition_typeString (readonly)

Returns always DefinitionType::PROTOCOL.

Returns:

  • (String)

    always DefinitionType::PROTOCOL



99
100
101
# File 'lib/bsv/registry/types.rb', line 99

def definition_type
  @definition_type
end

#descriptionString (readonly)

Returns description of the protocol’s purpose.

Returns:

  • (String)

    description of the protocol’s purpose



111
112
113
# File 'lib/bsv/registry/types.rb', line 111

def description
  @description
end

#documentation_urlString (readonly)

Returns URL to the protocol documentation.

Returns:

  • (String)

    URL to the protocol documentation



114
115
116
# File 'lib/bsv/registry/types.rb', line 114

def documentation_url
  @documentation_url
end

#icon_urlString (readonly)

Returns URL or opaque string for the protocol icon.

Returns:

  • (String)

    URL or opaque string for the protocol icon



108
109
110
# File 'lib/bsv/registry/types.rb', line 108

def icon_url
  @icon_url
end

#nameString (readonly)

Returns human-readable name.

Returns:

  • (String)

    human-readable name



105
106
107
# File 'lib/bsv/registry/types.rb', line 105

def name
  @name
end

#protocol_idArray (readonly)

Returns two-element BRC-43 protocol ID, e.g. [1, ‘protomap’].

Returns:

  • (Array)

    two-element BRC-43 protocol ID, e.g. [1, ‘protomap’]



102
103
104
# File 'lib/bsv/registry/types.rb', line 102

def protocol_id
  @protocol_id
end

#registry_operatorString? (readonly)

Returns public key hex of the registry operator.

Returns:

  • (String, nil)

    public key hex of the registry operator



117
118
119
# File 'lib/bsv/registry/types.rb', line 117

def registry_operator
  @registry_operator
end