Class: Moory::Logistic::Unit
- Inherits:
-
Object
- Object
- Moory::Logistic::Unit
- Includes:
- Efferent
- Defined in:
- lib/moory/logistic.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#quarantine ⇒ Object
Returns the value of attribute quarantine.
Attributes included from Efferent
Attributes included from Afferent
Instance Method Summary collapse
-
#initialize(rules:, initial: '^', quarantine: nil) ⇒ Unit
constructor
A new instance of Unit.
- #issue(stimulus) ⇒ Object
- #prime ⇒ Object
Methods included from Afferent
Constructor Details
#initialize(rules:, initial: '^', quarantine: nil) ⇒ Unit
Returns a new instance of Unit.
14 15 16 17 18 |
# File 'lib/moory/logistic.rb', line 14 def initialize(rules:, initial:'^',quarantine:nil) @initial = initial @quarantine = quarantine configure(rules) end |
Instance Attribute Details
#quarantine ⇒ Object
Returns the value of attribute quarantine.
12 13 14 |
# File 'lib/moory/logistic.rb', line 12 def quarantine @quarantine end |
Instance Method Details
#issue(stimulus) ⇒ Object
20 21 22 23 24 |
# File 'lib/moory/logistic.rb', line 20 def issue(stimulus) understand?(stimulus) ? super : bad_stimulus(stimulus) end |
#prime ⇒ Object
26 27 28 |
# File 'lib/moory/logistic.rb', line 26 def prime @state = @initial end |