Sha256: 4f8a429bd8ae4ce2622ad1d98669ac168a797431aa6aa4dc5f28528dae1caf17

Contents?: true

Size: 666 Bytes

Versions: 3

Compression:

Stored size: 666 Bytes

Contents

module BlockScore
  class Candidate < BlockScore::Base
    extend Forwardable

    include BlockScore::Actions::Create
    include BlockScore::Actions::Retrieve
    include BlockScore::Actions::Update
    include BlockScore::Actions::Delete
    include BlockScore::Actions::All

    def_delegators 'self.class', :api_url, :endpoint, :get, :post

    def history
      resource_member 'history'
    end

    def hits
      resource_member 'hits'
    end

    def search(options = {})
      post "#{api_url}watchlists", options.merge(candidate_id: id)
    end

    private

    def resource_member(member)
      get "#{endpoint}/#{id}/#{member}", {}
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blockscore-4.2.1 lib/blockscore/candidate.rb
blockscore-4.2.0 lib/blockscore/candidate.rb
blockscore-4.1.2 lib/blockscore/candidate.rb