Class: MyTankInfo::TankReconciliationRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/my_tank_info/objects/tank_reconciliation_record.rb

Instance Method Summary collapse

Methods inherited from Object

#initialize, #method_missing, #respond_to_missing?

Constructor Details

This class inherits a constructor from MyTankInfo::Object

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MyTankInfo::Object

Instance Method Details

#book_inventoryObject



21
22
23
# File 'lib/my_tank_info/objects/tank_reconciliation_record.rb', line 21

def book_inventory
  (start_volume + deliveries_volume) - sales_volume
end

#is_missing?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/my_tank_info/objects/tank_reconciliation_record.rb', line 17

def is_missing?
  is_missing
end

#nameObject



5
6
7
# File 'lib/my_tank_info/objects/tank_reconciliation_record.rb', line 5

def name
  [tank_number, product_name].join(" - ")
end

#removed_from_ustObject

Used for Weekly reconciliation



26
27
28
# File 'lib/my_tank_info/objects/tank_reconciliation_record.rb', line 26

def removed_from_ust
  (start_volume + deliveries_volume) - end_volume
end

#started_atObject



13
14
15
# File 'lib/my_tank_info/objects/tank_reconciliation_record.rb', line 13

def started_at
  DateTime.parse(start_date_time)
end

#tank_numberObject



9
10
11
# File 'lib/my_tank_info/objects/tank_reconciliation_record.rb', line 9

def tank_number
  tank_numbers.join(", ")
end