class VkMusic::WebParser::WallSection

WallSection JSON parser

Public Instance Methods

audios() click to toggle source

@return [Array<Audio>]

# File lib/vk_music/web_parser/wall_section.rb, line 13
def audios
  return unless data&.key?('list')

  data['list'].map do |el|
    Utility::AudioDataParser.call(el, @client_id)
  end
end
data() click to toggle source

Parsed JSON

# File lib/vk_music/web_parser/wall_section.rb, line 8
def data
  @data ||= json['data'].first || {}
end
more?() click to toggle source

@return [Boolean]

# File lib/vk_music/web_parser/wall_section.rb, line 46
def more?
  return unless data&.key?('hasMore')

  data['hasMore'].to_s == '1'
end
real_size() click to toggle source

@return [Integer?]

# File lib/vk_music/web_parser/wall_section.rb, line 39
def real_size
  return unless data&.key?('totalCount')

  data['totalCount']
end
subtitle() click to toggle source

@return [String?]

# File lib/vk_music/web_parser/wall_section.rb, line 29
def subtitle
  return unless data&.key?('rawDescription')

  re = data['rawDescription']
  return if re.nil? || re.empty?

  re
end
title() click to toggle source

@return [String]

# File lib/vk_music/web_parser/wall_section.rb, line 22
def title
  return unless data&.key?('title')

  data['title'].to_s
end