Class: Azeroth::RoutesBuilder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/azeroth/routes_builder.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Builder resposible for adding routes methods to the controller

Author:

  • Darthjee

Instance Method Summary collapse

Constructor Details

#initialize(model, builder, options) ⇒ RoutesBuilder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of RoutesBuilder.

Parameters:

  • model (Model)

    resource interface

  • builder (Sinclair)

    methods builder

  • options (Option)


12
13
14
15
16
# File 'lib/azeroth/routes_builder.rb', line 12

def initialize(model, builder, options)
  @model = model
  @builder = builder
  @options = options
end

Instance Method Details

#appendArray<Sinclair::MethodDefinition>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Append the routes methods to be built

Returns:

  • (Array<Sinclair::MethodDefinition>)


21
22
23
24
25
# File 'lib/azeroth/routes_builder.rb', line 21

def append
  options.actions.each do |route|
    add_method(route, &route_code(route))
  end
end