Class: Jdoc::Link::RequestGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/jdoc/link.rb

Class Method Summary collapse

Class Method Details

.call(properties) ⇒ Hash

Note:

Not includes properties that have readOnly property

Generates example request body from given schema

Examples:

Jdoc::Link::RequestGenerator(schema.properties) #=> { "name" => "example", "description" => "foo bar." }

Parameters:

  • properties (Hash)

Returns:

  • (Hash)


262
263
264
# File 'lib/jdoc/link.rb', line 262

def self.call(properties)
  ResponseGenerator.call(properties.reject {|key, value| value.data["readOnly"] })
end