Sha256: d2410c779b1a3dccd820ca1d4836cc7166bacc565ebc433a9f491cf8eb9bbb98

Contents?: true

Size: 402 Bytes

Versions: 24

Compression:

Stored size: 402 Bytes

Contents

# frozen_string_literal: true

module Cocina
  module Generator
    # Class for generating from an openapi array
    class SchemaArray < SchemaBase
      def generate
        "attribute :#{name.camelize(:lower)}, Types::Strict::Array.of(#{array_of_type}).default([].freeze)"
      end

      def array_of_type
        schema_doc.items.name || dry_datatype(schema_doc.items)
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
cocina-models-0.99.1 lib/cocina/generator/schema_array.rb
cocina-models-0.99.0 lib/cocina/generator/schema_array.rb
cocina-models-0.98.1 lib/cocina/generator/schema_array.rb
cocina-models-0.98.0 lib/cocina/generator/schema_array.rb
cocina-models-0.96.0 lib/cocina/generator/schema_array.rb
cocina-models-0.95.1 lib/cocina/generator/schema_array.rb
cocina-models-0.95.0 lib/cocina/generator/schema_array.rb
cocina-models-0.94.2 lib/cocina/generator/schema_array.rb
cocina-models-0.94.1 lib/cocina/generator/schema_array.rb
cocina-models-0.94.0 lib/cocina/generator/schema_array.rb
cocina-models-0.93.1 lib/cocina/generator/schema_array.rb
cocina-models-0.93.0 lib/cocina/generator/schema_array.rb
cocina-models-0.92.0 lib/cocina/generator/schema_array.rb
cocina-models-0.91.4 lib/cocina/generator/schema_array.rb
cocina-models-0.91.3 lib/cocina/generator/schema_array.rb
cocina-models-0.91.2 lib/cocina/generator/schema_array.rb
cocina-models-0.91.1 lib/cocina/generator/schema_array.rb
cocina-models-0.91.0 lib/cocina/generator/schema_array.rb
cocina-models-0.90.0 lib/cocina/generator/schema_array.rb
cocina-models-0.89.1 lib/cocina/generator/schema_array.rb