Class: Fakeit::Openapi::Specification
- Inherits:
-
Object
- Object
- Fakeit::Openapi::Specification
- Defined in:
- lib/fakeit/openapi/specification.rb
Instance Method Summary collapse
-
#initialize(spec_file) ⇒ Specification
constructor
A new instance of Specification.
- #operation(method, path, options) ⇒ Object
Constructor Details
#initialize(spec_file) ⇒ Specification
Returns a new instance of Specification.
4 5 6 7 8 |
# File 'lib/fakeit/openapi/specification.rb', line 4 def initialize(spec_file) @spec_file = spec_file @mtime = File.mtime(spec_file) if File.exist?(spec_file) @doc = Fakeit::Openapi.load(spec_file) end |
Instance Method Details
#operation(method, path, options) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/fakeit/openapi/specification.rb', line 10 def operation(method, path, ) reload_spec if @mtime @doc .request_operation(method, path) &.then { Operation.new(_1, ) } end |