Module: Restspec::Schema::Types::TypeMethods

Included in:
SingleSchemaDSL
Defined in:
lib/restspec/schema/types/type_methods.rb

Instance Method Summary collapse

Instance Method Details

#array(options = {}) ⇒ Object

Creates a new ArrayType instance with the first argument passed as parameter to the ArrayType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



24
# File 'lib/restspec/schema/types/type_methods.rb', line 24

define_type_method :array, ArrayType

#boolean(options = {}) ⇒ Object

Creates a new BooleanType instance with the first argument passed as parameter to the BooleanType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



21
# File 'lib/restspec/schema/types/type_methods.rb', line 21

define_type_method :boolean, BooleanType

#date(options = {}) ⇒ Object

Creates a new DateType instance with the first argument passed as parameter to the DateType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



29
# File 'lib/restspec/schema/types/type_methods.rb', line 29

define_type_method :date, DateType

#datetime(options = {}) ⇒ Object

Creates a new DateTimeType instance with the first argument passed as parameter to the DateTimeType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



30
# File 'lib/restspec/schema/types/type_methods.rb', line 30

define_type_method :datetime, DateTimeType

#decimal(options = {}) ⇒ Object

Creates a new DecimalType instance with the first argument passed as parameter to the DecimalType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



20
# File 'lib/restspec/schema/types/type_methods.rb', line 20

define_type_method :decimal, DecimalType

#decimal_string(options = {}) ⇒ Object

Creates a new DecimalStringType instance with the first argument passed as parameter to the DecimalStringType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



22
# File 'lib/restspec/schema/types/type_methods.rb', line 22

define_type_method :decimal_string, DecimalStringType

#embedded_schema(options = {}) ⇒ Object

Creates a new EmbeddedSchemaType instance with the first argument passed as parameter to the EmbeddedSchemaType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



28
# File 'lib/restspec/schema/types/type_methods.rb', line 28

define_type_method :embedded_schema, EmbeddedSchemaType

#hash(options = {}) ⇒ Object

Creates a new HashType instance with the first argument passed as parameter to the HashType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



26
# File 'lib/restspec/schema/types/type_methods.rb', line 26

define_type_method :hash, HashType

#integer(options = {}) ⇒ Object

Creates a new IntegerType instance with the first argument passed as parameter to the IntegerType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



19
# File 'lib/restspec/schema/types/type_methods.rb', line 19

define_type_method :integer, IntegerType

#null(options = {}) ⇒ Object

Creates a new NullType instance with the first argument passed as parameter to the NullType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



27
# File 'lib/restspec/schema/types/type_methods.rb', line 27

define_type_method :null, NullType

#one_of(options = {}) ⇒ Object

Creates a new OneOfType instance with the first argument passed as parameter to the OneOfType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



25
# File 'lib/restspec/schema/types/type_methods.rb', line 25

define_type_method :one_of, OneOfType

#schema_id(options = {}) ⇒ Object

Creates a new SchemaIdType instance with the first argument passed as parameter to the SchemaIdType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



23
# File 'lib/restspec/schema/types/type_methods.rb', line 23

define_type_method :schema_id, SchemaIdType

#string(options = {}) ⇒ Object

Creates a new StringType instance with the first argument passed as parameter to the StringType constructor.

Parameters:

  • options (Hash, Object) (defaults to: {})

    A hash of options or something to instantiate the type.



18
# File 'lib/restspec/schema/types/type_methods.rb', line 18

define_type_method :string, StringType