Module: Grape::DSL::Helpers::BaseHelper

Included in:
API::Helpers
Defined in:
lib/grape/dsl/helpers.rb

Overview

This module extends user defined helpers to provide some API-specific functionality.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#apiObject

Returns the value of attribute api.



82
83
84
# File 'lib/grape/dsl/helpers.rb', line 82

def api
  @api
end

Instance Method Details

#api_changed(new_api) ⇒ Object



89
90
91
92
# File 'lib/grape/dsl/helpers.rb', line 89

def api_changed(new_api)
  @api = new_api
  process_named_params
end

#params(name, &block) ⇒ Object



84
85
86
87
# File 'lib/grape/dsl/helpers.rb', line 84

def params(name, &block)
  @named_params ||= {}
  @named_params[name] = block
end