Class: SpotifyWebApi::DisallowsObject
- Defined in:
- lib/spotify_web_api/models/disallows_object.rb
Overview
DisallowsObject Model.
Instance Attribute Summary collapse
-
#interrupting_playback ⇒ TrueClass | FalseClass
Interrupting playback.
-
#pausing ⇒ TrueClass | FalseClass
Pausing.
-
#resuming ⇒ TrueClass | FalseClass
Resuming.
-
#seeking ⇒ TrueClass | FalseClass
Seeking playback location.
-
#skipping_next ⇒ TrueClass | FalseClass
Skipping to the next context.
-
#skipping_prev ⇒ TrueClass | FalseClass
Skipping to the previous context.
-
#toggling_repeat_context ⇒ TrueClass | FalseClass
Toggling repeat context flag.
-
#toggling_repeat_track ⇒ TrueClass | FalseClass
Toggling repeat track flag.
-
#toggling_shuffle ⇒ TrueClass | FalseClass
Toggling shuffle flag.
-
#transferring_playback ⇒ TrueClass | FalseClass
Transfering playback between devices.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(interrupting_playback = SKIP, pausing = SKIP, resuming = SKIP, seeking = SKIP, skipping_next = SKIP, skipping_prev = SKIP, toggling_repeat_context = SKIP, toggling_shuffle = SKIP, toggling_repeat_track = SKIP, transferring_playback = SKIP) ⇒ DisallowsObject
constructor
A new instance of DisallowsObject.
Methods inherited from BaseModel
Constructor Details
#initialize(interrupting_playback = SKIP, pausing = SKIP, resuming = SKIP, seeking = SKIP, skipping_next = SKIP, skipping_prev = SKIP, toggling_repeat_context = SKIP, toggling_shuffle = SKIP, toggling_repeat_track = SKIP, transferring_playback = SKIP) ⇒ DisallowsObject
Returns a new instance of DisallowsObject.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 89 def initialize(interrupting_playback = SKIP, pausing = SKIP, resuming = SKIP, seeking = SKIP, skipping_next = SKIP, skipping_prev = SKIP, toggling_repeat_context = SKIP, toggling_shuffle = SKIP, toggling_repeat_track = SKIP, transferring_playback = SKIP) @interrupting_playback = interrupting_playback unless interrupting_playback == SKIP @pausing = pausing unless pausing == SKIP @resuming = resuming unless resuming == SKIP @seeking = seeking unless seeking == SKIP @skipping_next = skipping_next unless skipping_next == SKIP @skipping_prev = skipping_prev unless skipping_prev == SKIP @toggling_repeat_context = toggling_repeat_context unless toggling_repeat_context == SKIP @toggling_shuffle = toggling_shuffle unless toggling_shuffle == SKIP @toggling_repeat_track = toggling_repeat_track unless toggling_repeat_track == SKIP @transferring_playback = transferring_playback unless transferring_playback == SKIP end |
Instance Attribute Details
#interrupting_playback ⇒ TrueClass | FalseClass
Interrupting playback. Optional field.
14 15 16 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 14 def interrupting_playback @interrupting_playback end |
#pausing ⇒ TrueClass | FalseClass
Pausing. Optional field.
18 19 20 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 18 def pausing @pausing end |
#resuming ⇒ TrueClass | FalseClass
Resuming. Optional field.
22 23 24 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 22 def resuming @resuming end |
#seeking ⇒ TrueClass | FalseClass
Seeking playback location. Optional field.
26 27 28 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 26 def seeking @seeking end |
#skipping_next ⇒ TrueClass | FalseClass
Skipping to the next context. Optional field.
30 31 32 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 30 def skipping_next @skipping_next end |
#skipping_prev ⇒ TrueClass | FalseClass
Skipping to the previous context. Optional field.
34 35 36 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 34 def skipping_prev @skipping_prev end |
#toggling_repeat_context ⇒ TrueClass | FalseClass
Toggling repeat context flag. Optional field.
38 39 40 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 38 def toggling_repeat_context @toggling_repeat_context end |
#toggling_repeat_track ⇒ TrueClass | FalseClass
Toggling repeat track flag. Optional field.
46 47 48 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 46 def toggling_repeat_track @toggling_repeat_track end |
#toggling_shuffle ⇒ TrueClass | FalseClass
Toggling shuffle flag. Optional field.
42 43 44 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 42 def toggling_shuffle @toggling_shuffle end |
#transferring_playback ⇒ TrueClass | FalseClass
Transfering playback between devices. Optional field.
50 51 52 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 50 def transferring_playback @transferring_playback end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 107 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. interrupting_playback = hash.key?('interrupting_playback') ? hash['interrupting_playback'] : SKIP pausing = hash.key?('pausing') ? hash['pausing'] : SKIP resuming = hash.key?('resuming') ? hash['resuming'] : SKIP seeking = hash.key?('seeking') ? hash['seeking'] : SKIP skipping_next = hash.key?('skipping_next') ? hash['skipping_next'] : SKIP skipping_prev = hash.key?('skipping_prev') ? hash['skipping_prev'] : SKIP toggling_repeat_context = hash.key?('toggling_repeat_context') ? hash['toggling_repeat_context'] : SKIP toggling_shuffle = hash.key?('toggling_shuffle') ? hash['toggling_shuffle'] : SKIP toggling_repeat_track = hash.key?('toggling_repeat_track') ? hash['toggling_repeat_track'] : SKIP transferring_playback = hash.key?('transferring_playback') ? hash['transferring_playback'] : SKIP # Create object from extracted values. DisallowsObject.new(interrupting_playback, pausing, resuming, seeking, skipping_next, skipping_prev, toggling_repeat_context, toggling_shuffle, toggling_repeat_track, transferring_playback) end |
.names ⇒ Object
A mapping from model property names to API property names.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 53 def self.names @_hash = {} if @_hash.nil? @_hash['interrupting_playback'] = 'interrupting_playback' @_hash['pausing'] = 'pausing' @_hash['resuming'] = 'resuming' @_hash['seeking'] = 'seeking' @_hash['skipping_next'] = 'skipping_next' @_hash['skipping_prev'] = 'skipping_prev' @_hash['toggling_repeat_context'] = 'toggling_repeat_context' @_hash['toggling_shuffle'] = 'toggling_shuffle' @_hash['toggling_repeat_track'] = 'toggling_repeat_track' @_hash['transferring_playback'] = 'transferring_playback' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 85 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/spotify_web_api/models/disallows_object.rb', line 69 def self.optionals %w[ interrupting_playback pausing resuming seeking skipping_next skipping_prev toggling_repeat_context toggling_shuffle toggling_repeat_track transferring_playback ] end |