Sha256: 09578783f4dd2232077711d903c6838130566989671625818d2209c8cfceed0f

Contents?: true

Size: 470 Bytes

Versions: 9

Compression:

Stored size: 470 Bytes

Contents

require "hypernova/batch_url_builder"

class Hypernova::HttpClientRequest
  def self.post(payload)
    if is_client_requiring_1_argument?
      client.post(Hypernova::BatchUrlBuilder.path, payload)
    else
      client.post(payload)
    end
  end

  def self.client
    Hypernova.configuration.http_client
  end

  def self.is_client_requiring_1_argument?
    client.method(:post).arity == -2
  end

  private_class_method :client, :is_client_requiring_1_argument?
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hypernova-2.0.0 lib/hypernova/http_client_request.rb
hypernova-1.4.0 lib/hypernova/http_client_request.rb
hypernova-1.3.0 lib/hypernova/http_client_request.rb
hypernova-1.2.0 lib/hypernova/http_client_request.rb
hypernova-1.1.0 lib/hypernova/http_client_request.rb
hypernova-1.0.3 lib/hypernova/http_client_request.rb
hypernova-1.0.2 lib/hypernova/http_client_request.rb
hypernova-1.0.1 lib/hypernova/http_client_request.rb
hypernova-1.0.0 lib/hypernova/http_client_request.rb