Class: Cocina::Generator::Vocab

Inherits:
Object
  • Object
show all
Defined in:
lib/cocina/generator/vocab.rb

Overview

Class for generating a vocab

Instance Method Summary collapse

Constructor Details

#initialize(schemas) ⇒ Vocab

Returns a new instance of Vocab.



7
8
9
# File 'lib/cocina/generator/vocab.rb', line 7

def initialize(schemas)
  @schemas = schemas
end

Instance Method Details

#filenameObject



11
12
13
# File 'lib/cocina/generator/vocab.rb', line 11

def filename
  'vocab.rb'
end

#generateObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/cocina/generator/vocab.rb', line 15

def generate
  <<~RUBY
              # frozen_string_literal: true

              module Cocina
                module Models
                  # A digital repository object.  See http://sul-dlss.github.io/cocina-models/maps/DRO.json
                  class Vocab

    #{vocab_methods}

                  end
                end
    end
  RUBY
end