Sha256: 14bd89bb04607d6dd40d8bf738a433a7a7ed319dd61de94f6c7621b59d317ffa

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

module Cinii
  class Client
    class Dissertation < Base
      # https://support.nii.ac.jp/ja/cid/api/d_opensearch
      def list_dissertations(**params)
        response = send_get('/d/search', dissertation_params(params))
        Cinii::SearchResult::Dissertation.new(response)
      end

      # https://support.nii.ac.jp/ja/cid/api/d_json
      def book(naid)
        raise 'Not implemented yet.'
      end

      private

        def dissertation_params(params)
          {
            q:           params[:q],
            title:       params[:title],
            description: params[:description],
            author:      params[:author],
            grantor:     params[:grantor],
            grantorid:   params[:grantor_id],
            grantid:     params[:grant_id],
            degreename:  params[:degree_name],
            year_from:   params[:year_from],
            year_to:     params[:year_to],
            fulltext:    params[:full_text],
            range:       params[:range],
            sortorder:   params[:sortorder],
            p:           params[:page],
            count:       params[:count]
          }.compact
        end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cinii-0.1.1 lib/cinii/client/dissertation.rb
cinii-0.1.0 lib/cinii/client/dissertation.rb