Class: VkMusic::Playlist
- Inherits:
-
Object
- Object
- VkMusic::Playlist
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/vk_music/playlist.rb
Overview
Class representing VK playlist
Instance Attribute Summary collapse
-
#access_hash ⇒ String?
readonly
Access hash which should be part of link for some playlists.
-
#audios ⇒ Array
readonly
Audios array.
-
#id ⇒ Integer?
readonly
Playlist ID.
-
#owner_id ⇒ Integer?
readonly
Playlist owner ID.
-
#real_size ⇒ Integer?
readonly
Real size of playlist or
nil
if unknown. -
#subtitle ⇒ String?
readonly
Playlist subtitle.
-
#title ⇒ String
readonly
Playlist title.
Instance Method Summary collapse
-
#initialize(audios, id: nil, owner_id: nil, access_hash: nil, title: '', subtitle: nil, real_size: nil) ⇒ Playlist
constructor
Initialize new playlist.
Constructor Details
#initialize(audios, id: nil, owner_id: nil, access_hash: nil, title: '', subtitle: nil, real_size: nil) ⇒ Playlist
Initialize new playlist
32 33 34 35 36 37 38 39 40 |
# File 'lib/vk_music/playlist.rb', line 32 def initialize(audios, id: nil, owner_id: nil, access_hash: nil, title: '', subtitle: nil, real_size: nil) @audios = audios.dup @id = id @owner_id = owner_id @access_hash = access_hash @title = title.to_s.strip @subtitle = subtitle @real_size = real_size end |
Instance Attribute Details
#access_hash ⇒ String? (readonly)
Returns access hash which should be part of link for some playlists.
14 15 16 |
# File 'lib/vk_music/playlist.rb', line 14 def access_hash @access_hash end |
#audios ⇒ Array (readonly)
Returns audios array.
22 23 24 |
# File 'lib/vk_music/playlist.rb', line 22 def audios @audios end |
#id ⇒ Integer? (readonly)
Returns playlist ID.
10 11 12 |
# File 'lib/vk_music/playlist.rb', line 10 def id @id end |
#owner_id ⇒ Integer? (readonly)
Returns playlist owner ID.
12 13 14 |
# File 'lib/vk_music/playlist.rb', line 12 def owner_id @owner_id end |
#real_size ⇒ Integer? (readonly)
Returns real size of playlist or nil
if unknown.
20 21 22 |
# File 'lib/vk_music/playlist.rb', line 20 def real_size @real_size end |
#subtitle ⇒ String? (readonly)
Returns playlist subtitle. May be empty.
18 19 20 |
# File 'lib/vk_music/playlist.rb', line 18 def subtitle @subtitle end |
#title ⇒ String (readonly)
Returns playlist title.
16 17 18 |
# File 'lib/vk_music/playlist.rb', line 16 def title @title end |