Class: Biller
- Inherits:
-
Object
- Object
- Biller
- 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
Direct Known Subclasses
Instance Method Summary collapse
-
#bill(_bill:, _state:, _delta:, _record: nil) ⇒ Object
Makes bill for given state, delta and record.
-
#billing_period ⇒ Object
Gets VM billing period.
-
#check_biller ⇒ Object
Check if this biller should be used in Billing !important.
-
#costs ⇒ Object
Costs hash.
-
#initialize(vm) ⇒ Biller
constructor
A new instance of Biller.
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
25 26 27 |
# File 'service/biller.rb', line 25 def bill _bill:, _state:, _delta:, _record: nil 0 end |
#billing_period ⇒ Object
Gets VM billing period
19 20 21 |
# File 'service/biller.rb', line 19 def billing_period @vm['//BILLING_PERIOD'] end |
#check_biller ⇒ Object
Check if this biller should be used in Billing !important
14 15 16 |
# File 'service/biller.rb', line 14 def check_biller true end |
#costs ⇒ Object
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 |