Sha256: d05848873a3971db746f83c91a70d5aa666be22019b59381ffc54974c147d653

Contents?: true

Size: 459 Bytes

Versions: 81

Compression:

Stored size: 459 Bytes

Contents

# frozen_string_literal: true

module Cocina
  module Generator
    # Class for generating from an openapi schema
    class Datatype < SchemaBase
      def generate
        <<~RUBY
          # frozen_string_literal: true

          module Cocina
            module Models
              #{name} = Types::String.constrained(
                format: /#{schema_doc.pattern}/i
              )
            end
          end
        RUBY
      end
    end
  end
end

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
cocina-models-0.54.0.beta.1 lib/cocina/generator/datatype.rb
cocina-models-0.53.0 lib/cocina/generator/datatype.rb
cocina-models-0.52.0 lib/cocina/generator/datatype.rb
cocina-models-0.51.0 lib/cocina/generator/datatype.rb
cocina-models-0.50.0 lib/cocina/generator/datatype.rb
cocina-models-0.49.0 lib/cocina/generator/datatype.rb
cocina-models-0.48.0 lib/cocina/generator/datatype.rb
cocina-models-0.47.2 lib/cocina/generator/datatype.rb
cocina-models-0.47.1 lib/cocina/generator/datatype.rb
cocina-models-0.47.0 lib/cocina/generator/datatype.rb
cocina-models-0.46.0 lib/cocina/generator/datatype.rb
cocina-models-0.45.0 lib/cocina/generator/datatype.rb
cocina-models-0.44.0 lib/cocina/generator/datatype.rb
cocina-models-0.43.0 lib/cocina/generator/datatype.rb
cocina-models-0.42.1 lib/cocina/generator/datatype.rb
cocina-models-0.42.0 lib/cocina/generator/datatype.rb
cocina-models-0.41.0 lib/cocina/generator/datatype.rb
cocina-models-0.40.1 lib/cocina/generator/datatype.rb
cocina-models-0.40.0 lib/cocina/generator/datatype.rb
cocina-models-0.39.0 lib/cocina/generator/datatype.rb