Sha256: b4b180be2b201f2b12eded8686a53e7ad84192f86fabb88ad6852c9ad1b0f9fe

Contents?: true

Size: 1001 Bytes

Versions: 6

Compression:

Stored size: 1001 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'
require 'ehbrs_ruby_utils/music/ous/artist'
require 'ehbrs_ruby_utils/music/ous/node'

module EhbrsRubyUtils
  module Music
    module Ous
      class Album < ::EhbrsRubyUtils::Music::Ous::Node
        include ::Comparable

        def <=>(other)
          to_a <=> other.to_a
        end

        def to_a
          [language, category.name, artist.name, name]
        end

        def to_spreader_t1_path
          to_a
        end

        def to_label
          (to_a + [id]).map(&:light_white).join(' | '.blue)
        end

        delegate :to_path, to: :path

        def id
          [artist.name, name].join('_').variableize
        end

        # @return [EhbrsRubyUtils::Music::Ous::Artist]
        def artist
          parent_node
        end

        def category
          artist.parent_node
        end

        def parent_node_class
          ::EhbrsRubyUtils::Music::Ous::Artist
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ehbrs_ruby_utils-0.17.3 lib/ehbrs_ruby_utils/music/ous/album.rb
ehbrs_ruby_utils-0.17.2 lib/ehbrs_ruby_utils/music/ous/album.rb
ehbrs_ruby_utils-0.17.1 lib/ehbrs_ruby_utils/music/ous/album.rb
ehbrs_ruby_utils-0.17.0 lib/ehbrs_ruby_utils/music/ous/album.rb
ehbrs_ruby_utils-0.16.1 lib/ehbrs_ruby_utils/music/ous/album.rb
ehbrs_ruby_utils-0.16.0 lib/ehbrs_ruby_utils/music/ous/album.rb