| 
									
										
										
										
											2017-03-08 16:32:31 +08:00
										 |  |  | # frozen_string_literal: true | 
					
						
							| 
									
										
										
										
											2017-03-28 17:15:33 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-12 04:54:01 +08:00
										 |  |  | module GrapeSwagger | 
					
						
							|  |  |  |   class MockParser | 
					
						
							|  |  |  |     attr_reader :model | 
					
						
							|  |  |  |     attr_reader :endpoint | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     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) |