Class: ApipieDSL::ReturnDescription::ReturnObject
- Inherits:
-
Object
- Object
- ApipieDSL::ReturnDescription::ReturnObject
- Defined in:
- lib/apipie_dsl/return_description.rb
Constant Summary
Constants included from Parameter
Instance Method Summary collapse
-
#default_param_group_scope ⇒ Object
this routine overrides Param#default_param_group_scope and is called if Param#param_group is invoked during the instance_exec call in ReturnObject#initialize.
- #docs(lang = nil) ⇒ Object
-
#initialize(method_description, options, block) ⇒ ReturnObject
constructor
A new instance of ReturnObject.
- #return_class ⇒ Object
Methods included from Parameter
#block, #define_param_group, #keyword, #list, #optional, #param, #param_group, #required
Methods included from Base
#apipie_eval_dsl, #dsl_data, #dsl_data_clear
Constructor Details
#initialize(method_description, options, block) ⇒ ReturnObject
Returns a new instance of ReturnObject.
9 10 11 12 13 14 15 |
# File 'lib/apipie_dsl/return_description.rb', line 9 def initialize(method_description, , block) @method_description = method_description @scope = [:scope] @param_group = { scope: @scope } @options = @return_type = (@options.keys & %i[array_of one_of object_of param_group]).first end |
Instance Method Details
#default_param_group_scope ⇒ Object
this routine overrides Param#default_param_group_scope and is called if Param#param_group is invoked during the instance_exec call in ReturnObject#initialize
20 21 22 |
# File 'lib/apipie_dsl/return_description.rb', line 20 def default_param_group_scope @scope end |
#docs(lang = nil) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/apipie_dsl/return_description.rb', line 35 def docs(lang = nil) { meta: @return_type, class: return_class, data: @options[@return_type] } end |
#return_class ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/apipie_dsl/return_description.rb', line 24 def return_class case @return_type when :object_of @options[@return_type] when :one_of, :param_group Object when :array_of Array end end |