Class: Brainstem::ApiDocs::Sinks::OpenApiSpecificationSink

Inherits:
AbstractSink
  • Object
show all
Extended by:
Forwardable
Includes:
Formatters::OpenApiSpecification::Helper
Defined in:
lib/brainstem/api_docs/sinks/open_api_specification_sink.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Formatters::OpenApiSpecification::Helper

#format_http_method, #format_sentence, #format_tag_name, #presenter_title, #type_and_format, #uncapitalize

Methods included from Concerns::Optional

#initialize

Instance Attribute Details

#api_versionObject

Returns the value of attribute api_version.



30
31
32
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 30

def api_version
  @api_version
end

#atlasObject

Returns the value of attribute atlas.



30
31
32
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 30

def atlas
  @atlas
end

#formatObject

Returns the value of attribute format.



30
31
32
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 30

def format
  @format
end

#ignore_taggingObject

Returns the value of attribute ignore_tagging.



30
31
32
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 30

def ignore_tagging
  @ignore_tagging
end

#include_internalObject

Returns the value of attribute include_internal.



30
31
32
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 30

def include_internal
  @include_internal
end

#oas_filename_patternObject

Returns the value of attribute oas_filename_pattern.



30
31
32
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 30

def oas_filename_pattern
  @oas_filename_pattern
end

#outputObject

Returns the value of attribute output.



30
31
32
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 30

def output
  @output
end

#output_extensionObject

Returns the value of attribute output_extension.



30
31
32
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 30

def output_extension
  @output_extension
end

#write_method=(value) ⇒ Object

Sets the attribute write_method

Parameters:

  • value

    the value to set the attribute write_method to.



27
28
29
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 27

def write_method=(value)
  @write_method = value
end

#write_path=(value) ⇒ Object

Sets the attribute write_path

Parameters:

  • value

    the value to set the attribute write_path to.



27
28
29
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 27

def write_path=(value)
  @write_path = value
end

Instance Method Details

#<<(atlas) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 41

def <<(atlas)
  self.atlas  = atlas
  self.output = ActiveSupport::HashWithIndifferentAccess.new

  write_info_object!
  write_presenter_definitions!
  write_error_definitions!
  write_endpoint_definitions!
  write_tag_definitions!
  write_security_definitions!

  write_spec_to_file!
end

#valid_optionsObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/brainstem/api_docs/sinks/open_api_specification_sink.rb', line 14

def valid_options
  super | [
    :api_version,
    :ignore_tagging,
    :format,
    :write_method,
    :write_path,
    :oas_filename_pattern,
    :output_extension,
    :include_internal
  ]
end