Class: Pikuri::Skill::Activation::Open
- Inherits:
-
Object
- Object
- Pikuri::Skill::Activation::Open
- Defined in:
- lib/pikuri/skill/activation/open.rb
Overview
An Pikuri::Skill::Activation with no gate at all: every skill the catalog holds is
in play, paths: or not, and promoting is a no-op because there is
nothing left to promote.
open = Activation::Open.new(catalog: catalog)
open.get('writing-rdoc') # => #<Skill …> — gated, and reachable anyway
open.activate([rdoc]) # => [] — nothing to announce
What Extension falls back to when the agent was built without an
interloper:. A promotion reaches the model only through mid-loop
injection, so an agent with no interloper has no channel to un-hide a
skill on — and a library must not hide what it cannot bring back. The
gate is off there, exactly as it was before paths: existed.
Thread-safe.
Instance Attribute Summary collapse
- #catalog ⇒ Pikuri::Skill::Catalog readonly
Instance Method Summary collapse
-
#activate(_skills) ⇒ Array
Always empty: nothing here was ever withheld, so announcing would introduce a skill the model has had all along.
- #get(name) ⇒ Pikuri::Skill::Catalog::Skill?
-
#in_play?(name) ⇒ Boolean
True for any name the catalog holds.
-
#initialize(catalog:) ⇒ Open
constructor
A new instance of Open.
-
#names ⇒ Array<String>
Every name the catalog holds, sorted.
-
#reset ⇒ void
No-op: there is never anything to clear.
Constructor Details
#initialize(catalog:) ⇒ Open
Returns a new instance of Open.
23 24 25 |
# File 'lib/pikuri/skill/activation/open.rb', line 23 def initialize(catalog:) @catalog = catalog end |
Instance Attribute Details
#catalog ⇒ Pikuri::Skill::Catalog (readonly)
28 29 30 |
# File 'lib/pikuri/skill/activation/open.rb', line 28 def catalog @catalog end |
Instance Method Details
#activate(_skills) ⇒ Array
Returns always empty: nothing here was ever withheld, so announcing would introduce a skill the model has had all along.
44 |
# File 'lib/pikuri/skill/activation/open.rb', line 44 def activate(_skills) = [] |
#get(name) ⇒ Pikuri::Skill::Catalog::Skill?
36 |
# File 'lib/pikuri/skill/activation/open.rb', line 36 def get(name) = @catalog.get(name) |
#in_play?(name) ⇒ Boolean
Returns true for any name the catalog holds.
32 |
# File 'lib/pikuri/skill/activation/open.rb', line 32 def in_play?(name) = !@catalog.get(name).nil? |
#names ⇒ Array<String>
Returns every name the catalog holds, sorted.
39 |
# File 'lib/pikuri/skill/activation/open.rb', line 39 def names = @catalog.list.map(&:name).sort |
#reset ⇒ void
This method returns an undefined value.
Returns no-op: there is never anything to clear.
47 |
# File 'lib/pikuri/skill/activation/open.rb', line 47 def reset = nil |