Class: Apipie::Generator::Swagger::MethodDescription::ApiDecorator

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/apipie/generator/swagger/method_description/api_decorator.rb

Instance Method Summary collapse

Instance Method Details

#normalized_http_methodObject



2
3
4
# File 'lib/apipie/generator/swagger/method_description/api_decorator.rb', line 2

def normalized_http_method
  @normalized_http_method ||= http_method.downcase
end

#summary(method_description:, language:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/apipie/generator/swagger/method_description/api_decorator.rb', line 6

def summary(method_description:, language:)
  s = Apipie.app.translate(short_description, language)

  if s.blank?
    Apipie::Generator::Swagger::Warning.for_code(
      Apipie::Generator::Swagger::Warning::MISSING_METHOD_SUMMARY_CODE,
      method_description.ruby_name
    ).warn_through_writer

    nil
  else
    s
  end
end