Class: PurlFetcher::Client::Mods

Inherits:
Object
  • Object
show all
Defined in:
lib/purl_fetcher/client/mods.rb

Overview

Create a MODS represenation of Cocina JSON

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cocina:) ⇒ Mods

Returns a new instance of Mods.

Parameters:

  • cocina (Cocina::Models::Dro)

    the Cocina JSON representation of the object



13
14
15
# File 'lib/purl_fetcher/client/mods.rb', line 13

def initialize(cocina:)
  @cocina = cocina
end

Class Method Details

.create(cocina:) ⇒ Object

Parameters:

  • cocina (Cocina::Models::Dro)

    the Cocina JSON representation of the object



8
9
10
# File 'lib/purl_fetcher/client/mods.rb', line 8

def self.create(cocina:)
  new(cocina:).create
end

Instance Method Details

#createObject



17
18
19
# File 'lib/purl_fetcher/client/mods.rb', line 17

def create
  response = client.post(path:, body:)
end