Class: BSV::Overlay::AdminTokenTemplate::Advertisement

Inherits:
Object
  • Object
show all
Defined in:
lib/bsv/overlay/admin_token_template.rb

Overview

Decoded representation of a SHIP or SLAP advertisement.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(protocol:, identity_key:, domain:, topic_or_service:) ⇒ Advertisement

Returns a new instance of Advertisement.

Parameters:

  • protocol (String)
  • identity_key (String)
  • domain (String)
  • topic_or_service (String)


51
52
53
54
55
56
# File 'lib/bsv/overlay/admin_token_template.rb', line 51

def initialize(protocol:, identity_key:, domain:, topic_or_service:)
  @protocol = protocol
  @identity_key = identity_key
  @domain = domain
  @topic_or_service = topic_or_service
end

Instance Attribute Details

#domainString (readonly)

Returns domain where the topic or service is available.

Returns:

  • (String)

    domain where the topic or service is available



42
43
44
# File 'lib/bsv/overlay/admin_token_template.rb', line 42

def domain
  @domain
end

#identity_keyString (readonly)

Returns hex-encoded compressed public key (33 bytes).

Returns:

  • (String)

    hex-encoded compressed public key (33 bytes)



39
40
41
# File 'lib/bsv/overlay/admin_token_template.rb', line 39

def identity_key
  @identity_key
end

#protocolString (readonly)

Returns protocol identifier — ‘SHIP’ or ‘SLAP’.

Returns:

  • (String)

    protocol identifier — ‘SHIP’ or ‘SLAP’



36
37
38
# File 'lib/bsv/overlay/admin_token_template.rb', line 36

def protocol
  @protocol
end

#topic_or_serviceString (readonly)

Returns topic or service name being advertised.

Returns:

  • (String)

    topic or service name being advertised



45
46
47
# File 'lib/bsv/overlay/admin_token_template.rb', line 45

def topic_or_service
  @topic_or_service
end