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_description, #format_http_method, #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.



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

def api_version
  @api_version
end

#atlasObject

Returns the value of attribute atlas.



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

def atlas
  @atlas
end

#formatObject

Returns the value of attribute format.



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

def format
  @format
end

#ignore_taggingObject

Returns the value of attribute ignore_tagging.



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

def ignore_tagging
  @ignore_tagging
end

#oas_filename_patternObject

Returns the value of attribute oas_filename_pattern.



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

def oas_filename_pattern
  @oas_filename_pattern
end

#outputObject

Returns the value of attribute output.



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

def output
  @output
end

#output_extensionObject

Returns the value of attribute output_extension.



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

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.



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

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.



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

def write_path=(value)
  @write_path = value
end

Instance Method Details

#<<(atlas) ⇒ Object



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

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
# 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,
  ]
end