lib/cocina/generator/schema_base.rb in cocina-models-0.79.0 vs lib/cocina/generator/schema_base.rb in cocina-models-0.80.0

- old
+ new

@@ -39,10 +39,16 @@ return '' unless schema_doc.description "# #{schema_doc.description}\n" end + def deprecation + return '' unless schema_doc.deprecated? + + "# DEPRECATED\n" + end + def example return '' unless schema_doc.example "# example: #{schema_doc.example}\n" end @@ -79,9 +85,13 @@ when 'date-time' 'Params::DateTime' else 'Strict::String' end + end + + def preamble + "#{deprecation}#{description}#{example}#{relaxed_comment}" end end end end