Sha256: 1e823bd97dc5f62fb3b40a19085bec81bd905b6c3b6ab2bea3dea8d051cf5adb

Contents?: true

Size: 685 Bytes

Versions: 3

Compression:

Stored size: 685 Bytes

Contents

require 'fakeit/openapi/example/array_example'
require 'fakeit/openapi/example/boolean_example'
require 'fakeit/openapi/example/integer_example'
require 'fakeit/openapi/example/number_example'
require 'fakeit/openapi/example/object_example'
require 'fakeit/openapi/example/string_example'

module Fakeit
  module Openapi
    module Schema
      include Fakeit::Openapi::Example

      def to_example(use_example = false)
        return example if use_example && example

        case type
        when 'string', 'integer', 'number', 'boolean' then send("#{type}_example")
        when 'array', 'object' then send("#{type}_example", use_example)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fakeit-0.1.4 lib/fakeit/openapi/schema.rb
fakeit-0.1.3 lib/fakeit/openapi/schema.rb
fakeit-0.1.2 lib/fakeit/openapi/schema.rb