Sha256: 43e8e3a6178d39e8c79abc1cf9414e3c19758d2b5621e2324a758bb782dc799e

Contents?: true

Size: 534 Bytes

Versions: 11

Compression:

Stored size: 534 Bytes

Contents

# frozen_string_literal: true

module IronBank
  # Base class for Zuora operations, e.g., billing preview
  #
  class Operation
    private_class_method :new

    def self.call(args)
      new(args).call
    end

    def call
      IronBank.client.connection.post(endpoint, params).body
    end

    private

    attr_reader :args

    def initialize(args)
      @args = args
    end

    def endpoint
      "v1/operations/#{IronBank::Utils.kebab(name)}"
    end

    def name
      self.class.name.split('::').last
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
iron_bank-2.2.0 lib/iron_bank/operation.rb
iron_bank-2.1.0 lib/iron_bank/operation.rb
iron_bank-2.0.2 lib/iron_bank/operation.rb
iron_bank-2.0.1 lib/iron_bank/operation.rb
iron_bank-2.0.0 lib/iron_bank/operation.rb
iron_bank-1.0.4 lib/iron_bank/operation.rb
iron_bank-1.0.3 lib/iron_bank/operation.rb
iron_bank-1.0.2 lib/iron_bank/operation.rb
iron_bank-1.0.1 lib/iron_bank/operation.rb
iron_bank-1.0.0 lib/iron_bank/operation.rb
iron_bank-0.7.1 lib/iron_bank/operation.rb