Module: ODDB::PackageObserver

Included in:
CommercialForm, GenericGroup, Narcotic
Defined in:
src/model/package_observer.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) packages (readonly)

Returns the value of attribute packages



6
7
8
# File 'src/model/package_observer.rb', line 6

def packages
  @packages
end

Instance Method Details

- (Object) add_package(package)



11
12
13
14
15
# File 'src/model/package_observer.rb', line 11

def add_package(package)
  @packages.push(package)
  @packages.odba_isolated_store
  @packages.last
end

- (Boolean) empty?

Returns:

  • (Boolean)


16
17
18
# File 'src/model/package_observer.rb', line 16

def empty?
  @packages.empty?
end

- (PackageObserver) initialize

A new instance of PackageObserver



7
8
9
10
# File 'src/model/package_observer.rb', line 7

def initialize
  super
  @packages = []
end

- (Object) package_count



19
20
21
# File 'src/model/package_observer.rb', line 19

def package_count
  @packages.size
end

- (Object) remove_package(package)



22
23
24
25
26
27
# File 'src/model/package_observer.rb', line 22

def remove_package(package)
  if(@packages.delete(package))
    @packages.odba_isolated_store
    package
  end
end