Sha256: 5fd7db110bfa09184bafd7393757667e46296cca343900710b3a0d774fb0acd1

Contents?: true

Size: 440 Bytes

Versions: 11

Compression:

Stored size: 440 Bytes

Contents

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

11 entries across 11 versions & 1 rubygems

Version Path
rakuten_web_service-1.9.0 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.8.0 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.7.0 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.6.1 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.6.0 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.5.0 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.4.2 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.4.1 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.4.0 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.3.0 lib/rakuten_web_service/genre_information.rb
rakuten_web_service-1.2.0 lib/rakuten_web_service/genre_information.rb