Class: Pikuri::Skill::Activation::Open

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(catalog:) ⇒ Open

Returns a new instance of Open.

Parameters:



23
24
25
# File 'lib/pikuri/skill/activation/open.rb', line 23

def initialize(catalog:)
  @catalog = catalog
end

Instance Attribute Details

#catalogPikuri::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.

Parameters:

Returns:

  • (Array)

    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?

Parameters:

  • name (String)

Returns:



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.

Parameters:

  • name (String)

Returns:

  • (Boolean)

    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?

#namesArray<String>

Returns every name the catalog holds, sorted.

Returns:

  • (Array<String>)

    every name the catalog holds, sorted



39
# File 'lib/pikuri/skill/activation/open.rb', line 39

def names = @catalog.list.map(&:name).sort

#resetvoid

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