Class: Apicraft::Mocker::OneOf

Inherits:
Base
  • Object
show all
Defined in:
lib/apicraft/mocker/one_of.rb

Overview

Generate mock based on the OneOf schema

Instance Attribute Summary

Attributes inherited from Base

#schema

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Apicraft::Mocker::Base

Instance Method Details

#mockObject



7
8
9
10
11
# File 'lib/apicraft/mocker/one_of.rb', line 7

def mock
  Mocker.mock(
    schema.one_of.sample
  )
end