Sha256: 77da40b8eac709e0b5ada6980855238e1df310817a1ac7ce953ac023a6bf95dd

Contents?: true

Size: 319 Bytes

Versions: 4

Compression:

Stored size: 319 Bytes

Contents

module GrapeSwagger
  module DocMethods
    class OptionalObject
      class << self
        def build(key, options, request = nil)
          if options[key]
            options[key].is_a?(Proc) ? options[key].call : options[key]
          else
            request
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
grape-swagger-0.20.3 lib/grape-swagger/doc_methods/optional_object.rb
grape-swagger-0.20.2 lib/grape-swagger/doc_methods/optional_object.rb
grape-swagger-0.20.1 lib/grape-swagger/doc_methods/optional_object.rb
grape-swagger-0.20.0 lib/grape-swagger/doc_methods/optional_object.rb