Class: Ace::Handbook::Organisms::ProviderSyncer
- Inherits:
-
Object
- Object
- Ace::Handbook::Organisms::ProviderSyncer
- Defined in:
- lib/ace/handbook/organisms/provider_syncer.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#inventory ⇒ Object
readonly
Returns the value of attribute inventory.
-
#project_root ⇒ Object
readonly
Returns the value of attribute project_root.
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Instance Method Summary collapse
-
#initialize(project_root: Ace::Handbook.project_root, registry: nil, inventory: nil, config: nil) ⇒ ProviderSyncer
constructor
A new instance of ProviderSyncer.
- #sync(provider: nil) ⇒ Object
Constructor Details
#initialize(project_root: Ace::Handbook.project_root, registry: nil, inventory: nil, config: nil) ⇒ ProviderSyncer
Returns a new instance of ProviderSyncer.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ace/handbook/organisms/provider_syncer.rb', line 11 def initialize( project_root: Ace::Handbook.project_root, registry: nil, inventory: nil, config: nil ) @project_root = project_root @registry = registry || Atoms::ProviderRegistry.new(project_root: project_root) @inventory = inventory || SkillInventory.new(project_root: project_root) @config = config || Ace::Handbook.config.resolve_namespace("handbook").to_h end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/ace/handbook/organisms/provider_syncer.rb', line 9 def config @config end |
#inventory ⇒ Object (readonly)
Returns the value of attribute inventory.
9 10 11 |
# File 'lib/ace/handbook/organisms/provider_syncer.rb', line 9 def inventory @inventory end |
#project_root ⇒ Object (readonly)
Returns the value of attribute project_root.
9 10 11 |
# File 'lib/ace/handbook/organisms/provider_syncer.rb', line 9 def project_root @project_root end |
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
9 10 11 |
# File 'lib/ace/handbook/organisms/provider_syncer.rb', line 9 def registry @registry end |
Instance Method Details
#sync(provider: nil) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/ace/handbook/organisms/provider_syncer.rb', line 23 def sync(provider: nil) skills = inventory.all source_breakdown = summarize_sources(skills) providers_to_sync(provider).map do |provider_id| sync_provider(provider_id, skills: skills, source_breakdown: source_breakdown) end end |