Class: Spotify::SessionConfig

Inherits:
Struct
  • Object
show all
Defined in:
lib/spotify/structs/session_config.rb

Overview

Spotify::Struct for Session configuration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

enclosing_module, #initialize, #to_h, #to_s

Methods included from TypeSafety

#to_native, #type_class

Constructor Details

This class inherits a constructor from Spotify::Struct

Instance Attribute Details

#api_versionFixnum

Returns the current value of api_version.

Returns:

  • (Fixnum)

    the current value of api_version



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def api_version
  @api_version
end

#application_key_sizesize_t

Returns the current value of application_key_size.

Returns:

  • (size_t)

    the current value of application_key_size



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def application_key_size
  @application_key_size
end

#ca_certs_filenameStringPointer

Returns the current value of ca_certs_filename.

Returns:

  • (StringPointer)

    the current value of ca_certs_filename



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def ca_certs_filename
  @ca_certs_filename
end

#cache_locationStringPointer

Returns the current value of cache_location.

Returns:

  • (StringPointer)

    the current value of cache_location



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def cache_location
  @cache_location
end

#callbacksStructPointer

Returns the current value of callbacks.

Returns:

  • (StructPointer)

    the current value of callbacks



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def callbacks
  @callbacks
end

#device_idStringPointer

Returns the current value of device_id.

Returns:

  • (StringPointer)

    the current value of device_id



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def device_id
  @device_id
end

#dont_save_metadata_for_playlistsFixnum

Returns the current value of dont_save_metadata_for_playlists.

Returns:

  • (Fixnum)

    the current value of dont_save_metadata_for_playlists



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def 
  @dont_save_metadata_for_playlists
end

#initially_unload_playlistsFixnum

Returns the current value of initially_unload_playlists.

Returns:

  • (Fixnum)

    the current value of initially_unload_playlists



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def initially_unload_playlists
  @initially_unload_playlists
end

#proxyStringPointer

Returns the current value of proxy.

Returns:

  • (StringPointer)

    the current value of proxy



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def proxy
  @proxy
end

#proxy_passwordStringPointer

Returns the current value of proxy_password.

Returns:

  • (StringPointer)

    the current value of proxy_password



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def proxy_password
  @proxy_password
end

#proxy_usernameStringPointer

Returns the current value of proxy_username.

Returns:

  • (StringPointer)

    the current value of proxy_username



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def proxy_username
  @proxy_username
end

#settings_locationStringPointer

Returns the current value of settings_location.

Returns:

  • (StringPointer)

    the current value of settings_location



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def settings_location
  @settings_location
end

#tracefileStringPointer

Returns the current value of tracefile.

Returns:

  • (StringPointer)

    the current value of tracefile



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def tracefile
  @tracefile
end

#user_agentStringPointer

Returns the current value of user_agent.

Returns:

  • (StringPointer)

    the current value of user_agent



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def user_agent
  @user_agent
end

#userdataPointer

Returns the current value of userdata.

Returns:

  • (Pointer)

    the current value of userdata



20
21
22
# File 'lib/spotify/structs/session_config.rb', line 20

def userdata
  @userdata
end

Instance Method Details

#[]=(key, value) ⇒ Object

Overridden for some keys for convenience.

Examples:

setting application key

struct[:application_key] = "application key"
# ^ also sets :application_key_size

Parameters:

  • key (Symbol)
  • value (Object)


49
50
51
52
53
54
55
56
# File 'lib/spotify/structs/session_config.rb', line 49

def []=(key, value)
  case key
  when :application_key
    super(key, value)
    self[:application_key_size] = value.bytesize if value
  else super
  end
end