module Restspec::Schema::Types::TypeMethods

Public Class Methods

define_type_method(method_name, type_class) click to toggle source

@private @!macro type_method

@!method $1(options = {})

Creates a new {$2} instance with the first argument
passed as parameter to the {$2} constructor.

@param options [Hash, Object] A hash of options or
  something to instantiate the type.
# File lib/restspec/schema/types/type_methods.rb, line 12
def self.define_type_method(method_name, type_class)
  define_method(method_name) do |*args|
    type_class.new(*args)
  end
end