Class: Biller

Inherits:
Object
  • Object
show all
Defined in:
service/biller.rb

Overview

Billers parent(actually template) class Needed just to describe what does Biller class should be able to do and provides couple of methods

Instance Method Summary collapse

Constructor Details

#initialize(vm) ⇒ Biller

Returns a new instance of Biller.



4
5
6
# File 'service/biller.rb', line 4

def initialize vm
  @vm = vm
end

Instance Method Details

#bill(_bill:, _state:, _delta:, _record: nil) ⇒ Object

Makes bill for given state, delta and record. Modifies :bill hash

Returns:

  • whatever



25
26
27
# File 'service/biller.rb', line 25

def bill _bill:, _state:, _delta:, _record: nil
  0
end

#billing_periodObject

Gets VM billing period



19
20
21
# File 'service/biller.rb', line 19

def billing_period
  @vm['//BILLING_PERIOD']
end

#check_billerObject

Check if this biller should be used in Billing !important



14
15
16
# File 'service/biller.rb', line 14

def check_biller
  true
end

#costsObject

Costs hash



9
10
11
# File 'service/biller.rb', line 9

def costs
  SETTINGS_TABLE.as_hash(:name, :body).select { |key| key.include? 'COST' }
end