Sha256: c1c4989637c0b4657155ffc86c58796e0dc98e10fed5fd69f7bae95379c16936

Contents?: true

Size: 1.61 KB

Versions: 7

Compression:

Stored size: 1.61 KB

Contents

require 'terminal/utils'

module Terminal
  module Modules
    module UsageAndCredits
      include Terminal::Utils

      # Get the current balance of your account
      #
      # @see https://www.terminal.com/api/docs#balance
      # @authentication Requires user_token and access_token
      # @return [Hash] of balance as a key
      def balance
        options = {}
        options[:auth] = true
        perform(:post, 'balance', options)
      end

      #  Get a history of charges to your account balance
      #
      # @see https://www.terminal.com/api/docs#burn-history
      # @authentication Requires user_token and access_token
      # @return [Hash] of history of account balance
      def burn_history
        options = {}
        options[:auth] = true
        perform(:post, 'burn_history', options)
      end

      #  Get a summary of current active charges to your account balance
      #
      # @see https://www.terminal.com/api/docs#burn-state
      # @authentication Requires user_token and access_token
      # @return [Hash] of current account balance
      def burn_state
        options = {}
        options[:auth] = true
        perform(:post, 'burn_state', options)
      end

      # Get a summary of the chargers to your account, based on each Terminal
      # instance to you have provisions
      #
      # @see https://www.terminal.com/api/docs#burn-estimates
      # @authentication Requires user_token and access_token
      # @return [Hash] of burn estimates
      def burn_estimates
        options = {}
        options[:auth] = true
        perform(:post, 'burn_estimates', options)
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cc-terminal-0.1.4 lib/terminal/modules/usage_and_credits.rb
cc-terminal-0.1.2 lib/terminal/modules/usage_and_credits.rb
cc-terminal-0.1.1 lib/terminal/modules/usage_and_credits.rb
cc-terminal-0.1.0 lib/terminal/modules/usage_and_credits.rb
cc-terminal-0.0.8 lib/terminal/modules/usage_and_credits.rb
cc-terminal-0.0.7 lib/terminal/modules/usage_and_credits.rb
cc-terminal-0.0.6 lib/terminal/modules/usage_and_credits.rb