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.63.0 lib/cocina/generator/datatype.rb
cocina-models-0.62.1 lib/cocina/generator/datatype.rb
cocina-models-0.62.0 lib/cocina/generator/datatype.rb
cocina-models-0.61.3 lib/cocina/generator/datatype.rb
cocina-models-0.61.2 lib/cocina/generator/datatype.rb
cocina-models-0.61.1 lib/cocina/generator/datatype.rb
cocina-models-0.61.0 lib/cocina/generator/datatype.rb
cocina-models-0.60.0 lib/cocina/generator/datatype.rb
cocina-models-0.59.1 lib/cocina/generator/datatype.rb
cocina-models-0.59.0 lib/cocina/generator/datatype.rb
cocina-models-0.58.2 lib/cocina/generator/datatype.rb
cocina-models-0.58.1 lib/cocina/generator/datatype.rb
cocina-models-0.58.0 lib/cocina/generator/datatype.rb
cocina-models-0.57.0 lib/cocina/generator/datatype.rb
cocina-models-0.56.1 lib/cocina/generator/datatype.rb
cocina-models-0.56.0 lib/cocina/generator/datatype.rb
cocina-models-0.55.0 lib/cocina/generator/datatype.rb
cocina-models-0.54.0 lib/cocina/generator/datatype.rb
cocina-models-0.54.0.beta.2 lib/cocina/generator/datatype.rb
cocina-models-0.53.1 lib/cocina/generator/datatype.rb