Sha256: dace5758bbeb114a7757da752f706fb3cd53432906ebec34515df9c2b4553002

Contents?: true

Size: 499 Bytes

Versions: 22

Compression:

Stored size: 499 Bytes

Contents

module Garage::OptionalResponseBodyResponder
  protected

  def api_behavior(*)
    case
    when put? && options[:put] && options[:put][:body]
      display resource, status: options[:put][:status] || :ok
    when patch? && options[:patch] && options[:patch][:body]
      display resource, status: options[:patch][:status] || :ok
    when delete? && options[:delete] && options[:delete][:body]
      display resource, status: options[:delete][:status] || :ok
    else
      super
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
the_garage-2.0.1 lib/garage/optional_response_body_responder.rb
the_garage-2.0.0 lib/garage/optional_response_body_responder.rb