Class: SelfSDK::Authenticated
- Inherits:
-
Object
- Object
- SelfSDK::Authenticated
- Defined in:
- lib/authenticated.rb
Instance Attribute Summary collapse
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#selfsdk ⇒ Object
Returns the value of attribute selfsdk.
-
#status ⇒ Object
Returns the value of attribute status.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
Instance Method Summary collapse
- #accepted? ⇒ Boolean
-
#initialize(payload) ⇒ Authenticated
constructor
A new instance of Authenticated.
- #to_hash ⇒ Object
Constructor Details
permalink #initialize(payload) ⇒ Authenticated
Returns a new instance of Authenticated.
5 6 7 8 9 10 11 |
# File 'lib/authenticated.rb', line 5 def initialize(payload) return if payload.nil? @payload = payload @uuid = payload[:cid] @selfsdk = payload[:sub] end |
Instance Attribute Details
permalink #payload ⇒ Object
Returns the value of attribute payload.
3 4 5 |
# File 'lib/authenticated.rb', line 3 def payload @payload end |
permalink #selfsdk ⇒ Object
Returns the value of attribute selfsdk.
3 4 5 |
# File 'lib/authenticated.rb', line 3 def selfsdk @selfsdk end |
permalink #status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/authenticated.rb', line 3 def status @status end |
permalink #uuid ⇒ Object
Returns the value of attribute uuid.
3 4 5 |
# File 'lib/authenticated.rb', line 3 def uuid @uuid end |
Instance Method Details
permalink #accepted? ⇒ Boolean
13 14 15 16 17 |
# File 'lib/authenticated.rb', line 13 def accepted? return false if @payload.nil? @payload[:status] == "accepted" end |
permalink #to_hash ⇒ Object
[View source]
19 20 21 22 23 |
# File 'lib/authenticated.rb', line 19 def to_hash { uuid: @uuid, selfsdk: @selfsdk, accepted: accepted? } end |