Class: Stock::MovementTarget

Inherits:
Ohm::Model
  • Object
show all
Defined in:
lib/porp/stock/movementtarget.rb

Overview

The MovementTarget class represents everything that can be the target of a

stock movement. It is subclassed by StockSourceDest, which represents
targets which create and destroy stock, and by StockHolding, which
represents physical stock holdings.

Direct Known Subclasses

Holding, SourceDest

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) inherited(subclass)

If inherited ensure the child gets attributes defined in higher classes



19
20
21
# File 'lib/porp/stock/movementtarget.rb', line 19

def self.inherited(subclass)
  subclass.attributes.concat(self.attributes).uniq!
end

Instance Method Details

- (Object) issue(movement)

Stub for issue method: needs to be implemented by subclasses



24
25
26
# File 'lib/porp/stock/movementtarget.rb', line 24

def issue(movement)
  false
end

- (Object) receive(movement)

Stub for receive method: needs to be implemented by subclasses



34
35
36
# File 'lib/porp/stock/movementtarget.rb', line 34

def receive(movement)
  false
end

- (Object) reload_attributes

Clear locally cached attributes, forcing reload from redis on next access. Looses any unsaved changes



40
41
42
# File 'lib/porp/stock/movementtarget.rb', line 40

def reload_attributes
  @_attributes.clear
end

- (Object) reverse_issue(movement)

Stub for reverse_issue method: needs to be implemented by subclasses



29
30
31
# File 'lib/porp/stock/movementtarget.rb', line 29

def reverse_issue(movement)
  false
end