Class: Cocina::Generator::SchemaValue
- Inherits:
-
SchemaBase
- Object
- SchemaBase
- Cocina::Generator::SchemaValue
- 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
-
#generate ⇒ Object
rubocop:disable Layout/LineLength.
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
#generate ⇒ Object
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 |