Class: Mobiscroll::Connect::ConnectionStatus
- Inherits:
-
Struct
- Object
- Struct
- Mobiscroll::Connect::ConnectionStatus
- Defined in:
- lib/mobiscroll/connect/models.rb
Overview
Result of Auth#get_connection_status. ‘connections` is keyed by lowercase provider name to match the API wire form.
Instance Attribute Summary collapse
-
#connections ⇒ Object
Returns the value of attribute connections.
-
#limit_reached ⇒ Object
Returns the value of attribute limit_reached.
Class Method Summary collapse
Instance Attribute Details
#connections ⇒ Object
Returns the value of attribute connections
49 50 51 |
# File 'lib/mobiscroll/connect/models.rb', line 49 def connections @connections end |
#limit_reached ⇒ Object
Returns the value of attribute limit_reached
49 50 51 |
# File 'lib/mobiscroll/connect/models.rb', line 49 def limit_reached @limit_reached end |
Class Method Details
.from_h(hash) ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/mobiscroll/connect/models.rb', line 50 def self.from_h(hash) return new(connections: {}, limit_reached: false) if hash.nil? raw = hash['connections'] || hash[:connections] || {} connections = raw.each_with_object({}) do |(provider, accounts), acc| acc[provider.to_s] = Array(accounts).map { |a| ConnectedAccount.from_h(a) } end new(connections: connections, limit_reached: hash['limitReached'] || hash[:limitReached] || false) end |