Class: BSV::Overlay::AdminTokenTemplate::Advertisement
- Inherits:
-
Object
- Object
- BSV::Overlay::AdminTokenTemplate::Advertisement
- Defined in:
- lib/bsv/overlay/admin_token_template.rb
Overview
Decoded representation of a SHIP or SLAP advertisement.
Instance Attribute Summary collapse
-
#domain ⇒ String
readonly
Domain where the topic or service is available.
-
#identity_key ⇒ String
readonly
Hex-encoded compressed public key (33 bytes).
-
#protocol ⇒ String
readonly
Protocol identifier — ‘SHIP’ or ‘SLAP’.
-
#topic_or_service ⇒ String
readonly
Topic or service name being advertised.
Instance Method Summary collapse
-
#initialize(protocol:, identity_key:, domain:, topic_or_service:) ⇒ Advertisement
constructor
A new instance of Advertisement.
Constructor Details
#initialize(protocol:, identity_key:, domain:, topic_or_service:) ⇒ Advertisement
Returns a new instance of Advertisement.
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
#domain ⇒ String (readonly)
Returns 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_key ⇒ String (readonly)
Returns 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 |
#protocol ⇒ String (readonly)
Returns protocol identifier — ‘SHIP’ or ‘SLAP’.
36 37 38 |
# File 'lib/bsv/overlay/admin_token_template.rb', line 36 def protocol @protocol end |
#topic_or_service ⇒ String (readonly)
Returns 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 |