Module: Fog::Billing

Defined in:
lib/fog/billing.rb,
lib/fog/storm_on_demand/billing.rb,
lib/fog/storm_on_demand/models/billing/invoice.rb,
lib/fog/storm_on_demand/models/billing/payment.rb,
lib/fog/storm_on_demand/models/billing/invoices.rb,
lib/fog/storm_on_demand/models/billing/payments.rb,
lib/fog/storm_on_demand/requests/billing/get_invoice.rb,
lib/fog/storm_on_demand/requests/billing/make_payment.rb,
lib/fog/storm_on_demand/requests/billing/next_invoice.rb,
lib/fog/storm_on_demand/requests/billing/list_invoices.rb

Defined Under Namespace

Classes: StormOnDemand

Class Method Summary collapse

Class Method Details

.[](provider) ⇒ Object



4
5
6
# File 'lib/fog/billing.rb', line 4

def self.[](provider)
  self.new(:provider => provider)
end

.new(attributes) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/fog/billing.rb', line 8

def self.new(attributes)
  attributes = attributes.dup
  provider = attributes.delete(:provider).to_s.downcase.to_sym
  if provider == :stormondemand
    require 'fog/storm_on_demand/billing'
    Fog::Billing::StormOnDemand.new(attributes)
  else
    raise ArgumentError.new("#{provider} has no billing service")
  end
end

.providersObject



19
20
21
# File 'lib/fog/billing.rb', line 19

def self.providers
  Fog.services[:billing]
end