Sha256: ee774ec23d10dfffe0321c539c643c99a36b62c775c4b21641534025a4edbdb5

Contents?: true

Size: 471 Bytes

Versions: 8

Compression:

Stored size: 471 Bytes

Contents

# frozen_string_literal: true

module RakutenWebService
  class GenreInformation
    attr_reader :parent, :current, :children

    def initialize(params, genre_class)
      @parent = Array(params['parent']).first
      @parent = genre_class.new(@parent) if @parent
      @current = Array(params['current']).first
      @current = genre_class.new(@current) if @current
      @children = params['children'].map { |child| genre_class.new(child['child']) }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rakuten_web_service-1.13.2 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.13.1 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.13.0 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.12.0 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.11.0 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.10.0 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.9.2 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.9.1 lib/rakuten_web_service/genre_information.rb