Class: ODDB::State::Drugs::RecentRegs::PackageMonth

Inherits:
Object
  • Object
show all
Includes:
ResultSort
Defined in:
src/state/drugs/recentregs.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from ResultSort

#dose_value, #galform_str, #generic_type_weight, #sort_result

Constructor Details

- (PackageMonth) initialize(date, regs, session)

A new instance of PackageMonth



16
17
18
19
20
21
22
23
24
25
# File 'src/state/drugs/recentregs.rb', line 16

def initialize(date, regs, session)
  @date = date
  packages = []
  regs.each { |reg|
    reg.each_package { |pack|
      packages.push(pack)
    }
  }
  @packages = sort_result(packages, session)
end

Instance Attribute Details

- (Object) date (readonly)

Returns the value of attribute date



15
16
17
# File 'src/state/drugs/recentregs.rb', line 15

def date
  @date
end

- (Object) packages (readonly)

Returns the value of attribute packages



15
16
17
# File 'src/state/drugs/recentregs.rb', line 15

def packages
  @packages
end

Instance Method Details

- (Object) package_count



26
27
28
# File 'src/state/drugs/recentregs.rb', line 26

def package_count
  @packages.size
end