Class: BSV::Identity::DisplayableIdentity
- Inherits:
-
Object
- Object
- BSV::Identity::DisplayableIdentity
- Defined in:
- lib/bsv/identity/types.rb
Overview
Formatted identity information for display in user interfaces.
Instance Attribute Summary collapse
-
#abbreviated_key ⇒ String
readonly
Shortened version of the identity key for compact display.
-
#avatar_url ⇒ String
readonly
URL or opaque string for the identity avatar image.
-
#badge_click_url ⇒ String?
readonly
URL to open when the badge is clicked.
-
#badge_icon_url ⇒ String?
readonly
URL or opaque string for a trust badge icon.
-
#badge_label ⇒ String?
readonly
Human-readable badge label (e.g. certifier name).
-
#identity_key ⇒ String
readonly
Full identity public key.
-
#name ⇒ String
readonly
Human-readable display name.
Instance Method Summary collapse
-
#initialize(name:, avatar_url:, abbreviated_key:, identity_key:, badge_icon_url: nil, badge_label: nil, badge_click_url: nil) ⇒ DisplayableIdentity
constructor
A new instance of DisplayableIdentity.
Constructor Details
#initialize(name:, avatar_url:, abbreviated_key:, identity_key:, badge_icon_url: nil, badge_label: nil, badge_click_url: nil) ⇒ DisplayableIdentity
Returns a new instance of DisplayableIdentity.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/bsv/identity/types.rb', line 35 def initialize(name:, avatar_url:, abbreviated_key:, identity_key:, badge_icon_url: nil, badge_label: nil, badge_click_url: nil) @name = name @avatar_url = avatar_url @abbreviated_key = abbreviated_key @identity_key = identity_key @badge_icon_url = badge_icon_url @badge_label = badge_label @badge_click_url = badge_click_url end |
Instance Attribute Details
#abbreviated_key ⇒ String (readonly)
Returns shortened version of the identity key for compact display.
14 15 16 |
# File 'lib/bsv/identity/types.rb', line 14 def abbreviated_key @abbreviated_key end |
#avatar_url ⇒ String (readonly)
Returns URL or opaque string for the identity avatar image.
11 12 13 |
# File 'lib/bsv/identity/types.rb', line 11 def avatar_url @avatar_url end |
#badge_click_url ⇒ String? (readonly)
Returns URL to open when the badge is clicked.
26 27 28 |
# File 'lib/bsv/identity/types.rb', line 26 def badge_click_url @badge_click_url end |
#badge_icon_url ⇒ String? (readonly)
Returns URL or opaque string for a trust badge icon.
20 21 22 |
# File 'lib/bsv/identity/types.rb', line 20 def badge_icon_url @badge_icon_url end |
#badge_label ⇒ String? (readonly)
Returns human-readable badge label (e.g. certifier name).
23 24 25 |
# File 'lib/bsv/identity/types.rb', line 23 def badge_label @badge_label end |
#identity_key ⇒ String (readonly)
Returns full identity public key.
17 18 19 |
# File 'lib/bsv/identity/types.rb', line 17 def identity_key @identity_key end |
#name ⇒ String (readonly)
Returns human-readable display name.
8 9 10 |
# File 'lib/bsv/identity/types.rb', line 8 def name @name end |