lib/swaggard/swagger/parameters/path.rb in swaggard-0.5.4 vs lib/swaggard/swagger/parameters/path.rb in swaggard-1.0.0

- old
+ new

@@ -3,19 +3,32 @@ module Swaggard module Swagger module Parameters class Path < Base - attr_reader :name + attr_reader :operation, :name - def initialize(param_name) + def initialize(operation, param_name) + @operation = operation @in = 'path' @name = param_name.to_s @data_type = 'string' @is_required = true - @description = "Scope response to #{@name}" end + def description + @description ||= get_description + end + + private + + def get_description + if Swaggard.configuration.path_parameter_description.respond_to?(:call) + Swaggard.configuration.path_parameter_description.call(self) + else + Swaggard.configuration.path_parameter_description + end + end end end end -end \ No newline at end of file +end