Class: Mobiscroll::Connect::ConnectedAccount
- Inherits:
-
Struct
- Object
- Struct
- Mobiscroll::Connect::ConnectedAccount
- Defined in:
- lib/mobiscroll/connect/models.rb
Overview
One connected calendar account.
granted_scopes are the scopes the provider actually granted, which are not
necessarily the ones Connect asked for: Google's consent screen lets the user untick
the calendar permission and still complete sign-in.
calendar_permission_granted is false for exactly those accounts — connected, but
no calendars can be read from them until the user reconnects and allows access. It
is nil when the question does not apply (Apple and CalDav authenticate with a
username and app password) or no scopes were recorded for the account.
Instance Attribute Summary collapse
-
#calendar_permission_granted ⇒ Object
Returns the value of attribute calendar_permission_granted.
-
#display ⇒ Object
Returns the value of attribute display.
-
#granted_scopes ⇒ Object
Returns the value of attribute granted_scopes.
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Attribute Details
#calendar_permission_granted ⇒ Object
Returns the value of attribute calendar_permission_granted
60 61 62 |
# File 'lib/mobiscroll/connect/models.rb', line 60 def @calendar_permission_granted end |
#display ⇒ Object
Returns the value of attribute display
60 61 62 |
# File 'lib/mobiscroll/connect/models.rb', line 60 def display @display end |
#granted_scopes ⇒ Object
Returns the value of attribute granted_scopes
60 61 62 |
# File 'lib/mobiscroll/connect/models.rb', line 60 def granted_scopes @granted_scopes end |
#id ⇒ Object
Returns the value of attribute id
60 61 62 |
# File 'lib/mobiscroll/connect/models.rb', line 60 def id @id end |
Class Method Details
.from_h(hash) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/mobiscroll/connect/models.rb', line 61 def self.from_h(hash) return nil if hash.nil? key = 'calendarPermissionGranted' granted = hash.key?(key) ? hash[key] : hash[key.to_sym] new( id: hash['id'] || hash[:id], display: hash['display'] || hash[:display], granted_scopes: Array(hash['grantedScopes'] || hash[:grantedScopes]), calendar_permission_granted: granted ) end |