Class: ODDB::State::Admin::PatinfoStatsCommon::SequenceFacade

Inherits:
Object
  • Object
show all
Defined in:
src/state/admin/patinfo_stats.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (SequenceFacade) initialize(sequence)

A new instance of SequenceFacade



23
24
25
26
27
28
29
# File 'src/state/admin/patinfo_stats.rb', line 23

def initialize(sequence)
  @iksnr = sequence.iksnr
  @seqnr = sequence.seqnr
  @pointer = sequence.pointer
  @name = sequence.name_base
  @invoice_items = [] 
end

Instance Attribute Details

- (Object) iksnr

Returns the value of attribute iksnr



22
23
24
# File 'src/state/admin/patinfo_stats.rb', line 22

def iksnr
  @iksnr
end

- (Object) pointer

Returns the value of attribute pointer



22
23
24
# File 'src/state/admin/patinfo_stats.rb', line 22

def pointer
  @pointer
end

- (Object) seqnr

Returns the value of attribute seqnr



22
23
24
# File 'src/state/admin/patinfo_stats.rb', line 22

def seqnr
  @seqnr
end

Instance Method Details

- (Object) add_invoice_item(invoice_item)



30
31
32
# File 'src/state/admin/patinfo_stats.rb', line 30

def add_invoice_item(invoice_item)
  @invoice_items.push(invoice_item)
end

- (Object) iksnr_seqnr



33
34
35
# File 'src/state/admin/patinfo_stats.rb', line 33

def iksnr_seqnr
  "#{@iksnr} #{@seqnr}: #{@name}"
end

- (Object) invoice_items



36
37
38
39
40
# File 'src/state/admin/patinfo_stats.rb', line 36

def invoice_items
  @invoice_items.sort_by { |item|
    item.time
  }.reverse
end

- (Object) newest_date



41
42
43
44
45
# File 'src/state/admin/patinfo_stats.rb', line 41

def newest_date
  @newest_date ||= @invoice_items.collect { |item| 
    item.time 
  }.max
end