Module: Betterdocs::JsonParamsRepresenter::ClassMethods
- Defined in:
- lib/betterdocs/json_params_representer.rb
Instance Method Summary collapse
- #build_result_object ⇒ Object
- #docs ⇒ Object
- #hashify(object) ⇒ Object
- #param(name, **options, &block) ⇒ Object
- #params ⇒ Object
Instance Method Details
#build_result_object ⇒ Object
6 7 8 |
# File 'lib/betterdocs/json_params_representer.rb', line 6 def build_result_object {}.with_indifferent_access end |
#docs ⇒ Object
16 17 18 |
# File 'lib/betterdocs/json_params_representer.rb', line 16 def docs @docs ||= Betterdocs::JsonParamsRepresenterCollector.new end |
#hashify(object) ⇒ Object
10 11 12 13 14 |
# File 'lib/betterdocs/json_params_representer.rb', line 10 def hashify(object) super do |result| assign_params result, object end end |
#param(name, **options, &block) ⇒ Object
31 32 33 34 35 |
# File 'lib/betterdocs/json_params_representer.rb', line 31 def param(name, **, &block) d = doc(:param, name, **, &block) and params << d self end |
#params ⇒ Object
27 28 29 |
# File 'lib/betterdocs/json_params_representer.rb', line 27 def params @params ||= Set.new end |