Class: Swagger::Blocks::ApiDeclarationNode
- Inherits:
-
Node
- Object
- Node
- Swagger::Blocks::ApiDeclarationNode
show all
- Defined in:
- lib/swagger/blocks.rb
Overview
Instance Attribute Summary
Attributes inherited from Node
#name
Instance Method Summary
collapse
Methods inherited from Node
#as_json, call, #data, #key
Instance Method Details
#api(&block) ⇒ Object
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
|
# File 'lib/swagger/blocks.rb', line 276
def api(&block)
self.data[:apis] ||= []
temp_api_node = Swagger::Blocks::ApiNode.call(&block)
api_node = self.data[:apis].select do |api|
api.data[:path] == temp_api_node.data[:path]
end[0]
if api_node
api_node.instance_eval(&block)
else
self.data[:apis] << temp_api_node
end
end
|