grape-swagger/spec/support/mock_parser.rb

26 lines
432 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'ostruct'
2016-05-12 04:54:01 +08:00
module GrapeSwagger
class MockParser
attr_reader :model, :endpoint
2016-05-12 04:54:01 +08:00
def initialize(model, endpoint)
@model = model
@endpoint = endpoint
end
def call
{
mock_data: {
type: :string,
description: "it's a mock"
}
}
end
end
end
GrapeSwagger.model_parsers.register(GrapeSwagger::MockParser, OpenStruct)