Class: Lotus::Identity
- Inherits:
-
Object
- Object
- Lotus::Identity
- Defined in:
- lib/lotus/identity.rb
Overview
Holds information about an Identity. This is more specific to identifying an Author than that structure. It is generally hosted in one place and not replicated. It holds identifying information that allow you to ensure verification of communication with the author.
Instance Attribute Summary collapse
-
#activity_inbox_endpoint ⇒ Object
readonly
Holds the activity streams inbox endpoint for this identity.
-
#activity_outbox_endpoint ⇒ Object
readonly
Holds the activity streams outbox endpoint for this identity.
-
#dialback_endpoint ⇒ Object
readonly
Holds the dialback endpoint used for capability transfer and authentication for this identity.
-
#profile_page ⇒ Object
readonly
Holds the url to this identity’s profile.
-
#public_key ⇒ Object
readonly
Holds the public key for this identity.
-
#salmon_endpoint ⇒ Object
readonly
Holds the salmon endpoint used for direct notifications for this identity.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Identity
constructor
Create an instance of an Identity.
-
#to_hash ⇒ Object
Returns a hash of the properties of the identity.
Constructor Details
#initialize(options = {}) ⇒ Identity
Create an instance of an Identity.
options:
:public_key => The identity's public key.
:salmon_endpoint => The salmon endpoint for this identity.
:dialback_endpoint => The dialback endpoint for this identity.
:activity_inbox_endpoint => The activity streams inbox for this
identity.
:activity_outbox_endpoint => The activity streams outbox for this
identity.
:profile_page => The url for this identity's profile page.
38 39 40 41 42 43 44 45 |
# File 'lib/lotus/identity.rb', line 38 def initialize( = {}) @public_key = [:public_key] @salmon_endpoint = [:salmon_endpoint] @dialback_endpoint = [:dialback_endpoint] @activity_inbox_endpoint = [:activity_inbox_endpoint] @activity_outbox_endpoint = [:activity_outbox_endpoint] @profile_page = [:profile_page] end |
Instance Attribute Details
#activity_inbox_endpoint ⇒ Object (readonly)
Holds the activity streams inbox endpoint for this identity.
19 20 21 |
# File 'lib/lotus/identity.rb', line 19 def activity_inbox_endpoint @activity_inbox_endpoint end |
#activity_outbox_endpoint ⇒ Object (readonly)
Holds the activity streams outbox endpoint for this identity.
22 23 24 |
# File 'lib/lotus/identity.rb', line 22 def activity_outbox_endpoint @activity_outbox_endpoint end |
#dialback_endpoint ⇒ Object (readonly)
Holds the dialback endpoint used for capability transfer and authentication for this identity.
16 17 18 |
# File 'lib/lotus/identity.rb', line 16 def dialback_endpoint @dialback_endpoint end |
#profile_page ⇒ Object (readonly)
Holds the url to this identity’s profile.
25 26 27 |
# File 'lib/lotus/identity.rb', line 25 def profile_page @profile_page end |
#public_key ⇒ Object (readonly)
Holds the public key for this identity.
8 9 10 |
# File 'lib/lotus/identity.rb', line 8 def public_key @public_key end |
#salmon_endpoint ⇒ Object (readonly)
Holds the salmon endpoint used for direct notifications for this identity.
12 13 14 |
# File 'lib/lotus/identity.rb', line 12 def salmon_endpoint @salmon_endpoint end |
Instance Method Details
#to_hash ⇒ Object
Returns a hash of the properties of the identity.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/lotus/identity.rb', line 48 def to_hash { :public_key => self.public_key, :salmon_endpoint => self.salmon_endpoint, :dialback_endpoint => self.dialback_endpoint, :activity_inbox_endpoint => self.activity_inbox_endpoint, :activity_outbox_endpoint => self.activity_outbox_endpoint, :profile_page => self.profile_page } end |