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
#initialize(payload) ⇒ Authenticated
Returns a new instance of Authenticated.
7 8 9 10 11 12 13 |
# File 'lib/authenticated.rb', line 7 def initialize(payload) return if payload.nil? @payload = payload @uuid = payload[:cid] @selfsdk = payload[:sub] end |
Instance Attribute Details
#payload ⇒ Object
Returns the value of attribute payload.
5 6 7 |
# File 'lib/authenticated.rb', line 5 def payload @payload end |
#selfsdk ⇒ Object
Returns the value of attribute selfsdk.
5 6 7 |
# File 'lib/authenticated.rb', line 5 def selfsdk @selfsdk end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/authenticated.rb', line 5 def status @status end |
#uuid ⇒ Object
Returns the value of attribute uuid.
5 6 7 |
# File 'lib/authenticated.rb', line 5 def uuid @uuid end |
Instance Method Details
#accepted? ⇒ Boolean
15 16 17 18 19 20 |
# File 'lib/authenticated.rb', line 15 def accepted? return false if @payload.nil? return false if @payload[:auth] != true @payload[:status] == "accepted" end |
#to_hash ⇒ Object
22 23 24 25 26 |
# File 'lib/authenticated.rb', line 22 def to_hash { uuid: @uuid, selfsdk: @selfsdk, accepted: accepted? } end |