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.86.0 lib/cocina/generator/datatype.rb
cocina-models-0.85.0 lib/cocina/generator/datatype.rb
cocina-models-0.84.5 lib/cocina/generator/datatype.rb
cocina-models-0.84.4 lib/cocina/generator/datatype.rb
cocina-models-0.84.3 lib/cocina/generator/datatype.rb
cocina-models-0.84.2 lib/cocina/generator/datatype.rb
cocina-models-0.84.1 lib/cocina/generator/datatype.rb
cocina-models-0.84.0 lib/cocina/generator/datatype.rb
cocina-models-0.83.0 lib/cocina/generator/datatype.rb
cocina-models-0.82.0 lib/cocina/generator/datatype.rb
cocina-models-0.81.0 lib/cocina/generator/datatype.rb
cocina-models-0.80.0 lib/cocina/generator/datatype.rb
cocina-models-0.79.0 lib/cocina/generator/datatype.rb
cocina-models-0.78.0 lib/cocina/generator/datatype.rb
cocina-models-0.77.0 lib/cocina/generator/datatype.rb
cocina-models-0.76.0 lib/cocina/generator/datatype.rb
cocina-models-0.75.0 lib/cocina/generator/datatype.rb
cocina-models-0.74.1 lib/cocina/generator/datatype.rb
cocina-models-0.74.0 lib/cocina/generator/datatype.rb
cocina-models-0.73.6 lib/cocina/generator/datatype.rb