Class: Cocina::Generator::SchemaValue

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

Overview

Class for generating from an openapi value

Instance Attribute Summary

Attributes inherited from SchemaBase

#key, #parent, #required, #schema_doc

Instance Method Summary collapse

Methods inherited from SchemaBase

#description, #dry_datatype, #example, #filename, #initialize, #name, #omittable, #quote, #string_dry_datatype

Constructor Details

This class inherits a constructor from Cocina::Generator::SchemaBase

Instance Method Details

#generateObject

rubocop:disable Layout/LineLength



8
9
10
# File 'lib/cocina/generator/schema_value.rb', line 8

def generate
  "#{description}#{example}attribute :#{name.camelize(:lower)}, Types::#{dry_datatype(schema_doc)}#{default}#{enum}#{omittable}"
end