Class: Riffer::Skills::Config
- Inherits:
-
Object
- Object
- Riffer::Skills::Config
- Defined in:
- lib/riffer/skills/config.rb
Overview
Configuration object for the skills block DSL.
Used inside the skills block on Riffer::Agent:
skills do
backend Riffer::Skills::FilesystemBackend.new(".skills")
adapter Riffer::Skills::XmlAdapter
activate ["code-review"]
end
Instance Method Summary collapse
-
#activate(value = nil) ⇒ Object
Gets or sets skill names to activate at startup.
-
#adapter(value = nil) ⇒ Object
Gets or sets a custom skill adapter class.
-
#backend(value = nil) ⇒ Object
Gets or sets the skills backend.
-
#initialize ⇒ Config
constructor
Creates a new Config with all options unset.
Constructor Details
#initialize ⇒ Config
Creates a new Config with all options unset.
– : () -> void
18 19 20 21 22 |
# File 'lib/riffer/skills/config.rb', line 18 def initialize @backend = nil @adapter = nil @activate = nil end |
Instance Method Details
#activate(value = nil) ⇒ Object
58 59 60 61 |
# File 'lib/riffer/skills/config.rb', line 58 def activate(value = nil) return @activate if value.nil? @activate = value end |
#adapter(value = nil) ⇒ Object
Gets or sets a custom skill adapter class.
Must be a subclass of Riffer::Skills::Adapter. Defaults to the provider’s preferred adapter.
– : (?singleton(Riffer::Skills::Adapter)?) -> singleton(Riffer::Skills::Adapter)?
43 44 45 46 |
# File 'lib/riffer/skills/config.rb', line 43 def adapter(value = nil) return @adapter if value.nil? @adapter = value end |
#backend(value = nil) ⇒ Object
Gets or sets the skills backend.
Accepts a Riffer::Skills::Backend instance, or a Proc that receives context and returns a Backend.
– : (?(Riffer::Skills::Backend | Proc)?) -> (Riffer::Skills::Backend | Proc)?
31 32 33 34 |
# File 'lib/riffer/skills/config.rb', line 31 def backend(value = nil) return @backend if value.nil? @backend = value end |