Class: Lotus::Identity

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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(options = {})
  @public_key               = options[:public_key]
  @salmon_endpoint          = options[:salmon_endpoint]
  @dialback_endpoint        = options[:dialback_endpoint]
  @activity_inbox_endpoint  = options[:activity_inbox_endpoint]
  @activity_outbox_endpoint = options[:activity_outbox_endpoint]
  @profile_page             = options[:profile_page]
end

Instance Attribute Details

#activity_inbox_endpointObject (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_endpointObject (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_endpointObject (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_pageObject (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_keyObject (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_endpointObject (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_hashObject

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