Skip to content

Commit a3964d8

Browse files
svenweyKagemaru
authored andcommitted
make naming of order_info and row_info uniform (info), such that from cockpit.rb both are accessible with a method called 'info'
1 parent 488b17a commit a3964d8

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

app/domain/order/cockpit.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ def total_hours
6060
end
6161

6262
def overall_not_billable_hours
63-
total.order_info[:overall_not_billable_hours].to_f
63+
total.info[:overall_not_billable_hours].to_f
6464
end
6565

6666
def overall_billable_hours
6767
overall_total_hours - overall_not_billable_hours
6868
end
6969

7070
def overall_total_hours
71-
total.order_info[:overall_supplied_services_hours].to_f
71+
total.info[:overall_supplied_services_hours].to_f
7272
end
7373

7474
def build_rows(period)

app/domain/order/cockpit/accounting_post_row.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
class Order
99
class Cockpit
1010
class AccountingPostRow < Row
11-
attr_reader :cells, :accounting_post, :row_info
11+
attr_reader :cells, :accounting_post, :info
1212

1313
def initialize(accounting_post, period, label = nil)
1414
super(label || accounting_post.to_s)
1515
@period = period
1616
@accounting_post = accounting_post
1717
@cells = build_cells
18-
@row_info = build_info
18+
@info = build_info
1919
end
2020

2121
def portfolio

app/domain/order/cockpit/total_row.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
class Order
99
class Cockpit
1010
class TotalRow < Row
11-
attr_reader :order_info
11+
attr_reader :info
1212

1313
def initialize(rows)
1414
super('Total')
1515
@cells = build_total_cells(rows)
16-
@order_info = build_order_info(rows)
16+
@info = build_info(rows)
1717
end
1818

1919
private
@@ -30,10 +30,10 @@ def build_total_cells(rows)
3030
hash
3131
end
3232

33-
# collect the row_info hash of every row and sum the individual values up (per key)
34-
def build_order_info(rows)
35-
row_infos = rows.collect(&:row_info)
36-
row_infos.each_with_object(Hash.new(0)) do |row, acc|
33+
# collect the info hash of every row and sum the individual values up (per key)
34+
def build_info(rows)
35+
infos = rows.collect(&:info)
36+
infos.each_with_object(Hash.new(0)) do |row, acc|
3737
row.each { |key, value| acc[key] += value }
3838
end
3939
end

0 commit comments

Comments
 (0)