Class: RubySky::Raw::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/rubysky/raw/session.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(refresh_jwt:, access_jwt:, did_doc:, handle:, email:, email_confirmed:, email_auth_factor:, active:, status:) ⇒ Session

Returns a new instance of Session.



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rubysky/raw/session.rb', line 9

def initialize(refresh_jwt:, access_jwt:, did_doc:, handle:, email:,
               email_confirmed:, email_auth_factor:, active:, status:)
  @refresh_jwt = refresh_jwt
  @access_jwt = access_jwt
  @did_doc = did_doc
  @handle = handle
  @email = email
  @email_confirmed = email_confirmed
  @email_auth_factor = email_auth_factor
  @active = active
  @status = status
end

Instance Attribute Details

#access_jwtObject (readonly)

Returns the value of attribute access_jwt.



6
7
8
# File 'lib/rubysky/raw/session.rb', line 6

def access_jwt
  @access_jwt
end

#activeObject (readonly)

Returns the value of attribute active.



6
7
8
# File 'lib/rubysky/raw/session.rb', line 6

def active
  @active
end

#did_docObject (readonly)

Returns the value of attribute did_doc.



6
7
8
# File 'lib/rubysky/raw/session.rb', line 6

def did_doc
  @did_doc
end

#emailObject (readonly)

Returns the value of attribute email.



6
7
8
# File 'lib/rubysky/raw/session.rb', line 6

def email
  @email
end

#email_auth_factorObject (readonly)

Returns the value of attribute email_auth_factor.



6
7
8
# File 'lib/rubysky/raw/session.rb', line 6

def email_auth_factor
  @email_auth_factor
end

#email_confirmedObject (readonly)

Returns the value of attribute email_confirmed.



6
7
8
# File 'lib/rubysky/raw/session.rb', line 6

def email_confirmed
  @email_confirmed
end

#handleObject (readonly)

Returns the value of attribute handle.



6
7
8
# File 'lib/rubysky/raw/session.rb', line 6

def handle
  @handle
end

#refresh_jwtObject (readonly)

Returns the value of attribute refresh_jwt.



6
7
8
# File 'lib/rubysky/raw/session.rb', line 6

def refresh_jwt
  @refresh_jwt
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/rubysky/raw/session.rb', line 6

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object



22
23
24
25
26
# File 'lib/rubysky/raw/session.rb', line 22

def self.from_hash(hash)
  allocate.tap do |this|
    this.update_by_hash hash
  end
end

Instance Method Details

#update_by_hash(hash) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/rubysky/raw/session.rb', line 28

def update_by_hash(hash)
  @refresh_jwt = hash["refreshJwt"]
  @access_jwt = hash["accessJwt"]
  @did_doc = DIDDoc.new(did: hash["did"], did_doc: hash["didDoc"])
  @handle = hash["handle"]
  @email = hash["email"]
  @email_confirmed = hash["emailConfirmed"]
  @email_auth_factor = hash["emailAuthFactor"]
  @active = hash["active"]
  @status = hash["status"]
end