Class: Wongi::Engine::NccPartner
- Includes:
- TokenContainer
- Defined in:
- lib/wongi-engine/beta/ncc_partner.rb
Instance Attribute Summary collapse
-
#divergent ⇒ Object
Returns the value of attribute divergent.
-
#ncc ⇒ Object
Returns the value of attribute ncc.
Attributes inherited from BetaNode
Instance Method Summary collapse
Methods inherited from BetaNode
#assignment_node, #depth, #initialize, #refresh, #refresh_child, #root?
Methods included from CoreExt
Constructor Details
This class inherits a constructor from Wongi::Engine::BetaNode
Instance Attribute Details
#divergent ⇒ Object
Returns the value of attribute divergent.
7 8 9 |
# File 'lib/wongi-engine/beta/ncc_partner.rb', line 7 def divergent @divergent end |
#ncc ⇒ Object
Returns the value of attribute ncc.
6 7 8 |
# File 'lib/wongi-engine/beta/ncc_partner.rb', line 6 def ncc @ncc end |
Instance Method Details
#beta_activate(token) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/wongi-engine/beta/ncc_partner.rb', line 9 def beta_activate token t = Token.new self, token, nil, {} owner = owner_for( t ) t..add_token(t, self) if owner owner.ncc_results << t t.owner = owner owner.node.ncc_deactivate owner end end |
#beta_deactivate(t) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/wongi-engine/beta/ncc_partner.rb', line 20 def beta_deactivate t token = tokens.find { |tok| tok.parent == t } return unless token token..remove_token(token, self) if owner = token.owner owner.ncc_results.delete token if owner.ncc_results.empty? ncc.ncc_activate owner end end end |