Class: Apipie::MethodDescription::ApisService

Inherits:
Object
  • Object
show all
Defined in:
lib/apipie/method_description/apis_service.rb

Overview

Service that builds the appropriate Apipie::MethodDescription::Api required by Apipie::MethodDescription

Instance Method Summary collapse

Constructor Details

#initialize(resource, controller_action, dsl) ⇒ ApisService

Returns a new instance of ApisService.

Parameters:



8
9
10
11
12
# File 'lib/apipie/method_description/apis_service.rb', line 8

def initialize(resource, controller_action, dsl)
  @resource = resource
  @controller_action = controller_action
  @dsl = dsl
end

Instance Method Details

#callArray<Apipie::MethodDescription::Api>

Returns:



15
16
17
18
19
20
21
22
23
24
# File 'lib/apipie/method_description/apis_service.rb', line 15

def call
  api_args.map do |http_method, path, desc, opts|
    Apipie::MethodDescription::Api.new(
      http_method,
      concern_subst(path),
      concern_subst(desc),
      opts
    )
  end
end