Class: Apipie::DSL::ResourceDescriptionDsl

Inherits:
Object
  • Object
show all
Includes:
Base, Common, Param, Resource
Defined in:
lib/apipie/dsl_definition.rb

Instance Attribute Summary

Attributes included from Base

#api_params, #apipie_resource_descriptions

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Param

#_default_param_group_scope, #param, #param_group, #property, #returns

Methods included from Resource

#api_base_url, #app_info, #deprecated, #name, #path, #resource_id, #short

Methods included from Common

#_apipie_define_validators, #_apipie_get_method_params, #_apipie_handle_validate_key_error, #_apipie_save_method_params, #api_versions, #desc, #document, #error, #formats, #header, #meta, #tags

Methods included from Base

#_apipie_eval_dsl

Constructor Details

#initialize(controller) ⇒ ResourceDescriptionDsl

Returns a new instance of ResourceDescriptionDsl.



617
618
619
# File 'lib/apipie/dsl_definition.rb', line 617

def initialize(controller)
  @controller = controller
end

Class Method Details

.eval_dsl(controller, &block) ⇒ Object

evaluates resource description DSL and returns results



622
623
624
625
626
627
628
# File 'lib/apipie/dsl_definition.rb', line 622

def self.eval_dsl(controller, &block)
  dsl_data  = self.new(controller)._apipie_eval_dsl(&block)
  if dsl_data[:api_versions].empty?
    dsl_data[:api_versions] = Apipie.controller_versions(controller)
  end
  dsl_data
end