Class: OasCore::Builders::SpecificationBuilder
- Inherits:
-
Object
- Object
- OasCore::Builders::SpecificationBuilder
- Defined in:
- lib/oas_core/builders/specification_builder.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize ⇒ SpecificationBuilder
constructor
A new instance of SpecificationBuilder.
- #with_oas_routes(oas_routes) ⇒ Object
Constructor Details
#initialize ⇒ SpecificationBuilder
Returns a new instance of SpecificationBuilder.
6 7 8 |
# File 'lib/oas_core/builders/specification_builder.rb', line 6 def initialize @specification = Spec::Specification.new end |
Instance Method Details
#build ⇒ Object
19 20 21 |
# File 'lib/oas_core/builders/specification_builder.rb', line 19 def build @specification end |
#with_oas_routes(oas_routes) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/oas_core/builders/specification_builder.rb', line 10 def with_oas_routes(oas_routes) grouped_routes = oas_routes.group_by(&:path) grouped_routes.each do |path, routes| @specification.paths.add_path(path, routes) end self end |