Class: Crossrefapi::Prefixes

Inherits:
Object
  • Object
show all
Defined in:
lib/crossrefapi/prefixes.rb

Overview

client = Crossrefapi::Client.new

response = client.prefixes.by_prefix('10.2305')
pp response

client = Crossrefapi::Client.new
query = { 'query.container-title' => 'IUCN Red List of Threatened Species', 'offset' => '9980' }
response = client.prefixes.by_prefix_works('10.2305', query)
pp response

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Prefixes

Returns a new instance of Prefixes.



21
22
23
# File 'lib/crossrefapi/prefixes.rb', line 21

def initialize(client)
  @client = client
end

Instance Method Details

#by_prefix(prefix) ⇒ Object



25
26
27
# File 'lib/crossrefapi/prefixes.rb', line 25

def by_prefix(prefix)
  @client.get("prefixes/#{prefix}")
end

#by_prefix_works(prefix, query = {}) ⇒ Object



29
30
31
# File 'lib/crossrefapi/prefixes.rb', line 29

def by_prefix_works(prefix, query = {})
  @client.get("prefixes/#{prefix}/works", query)
end