Class: Mistri::Skill
- Inherits:
-
Data
- Object
- Data
- Mistri::Skill
- Defined in:
- lib/mistri/skill.rb
Overview
One expert playbook: a name the model selects by, a description that earns the selection, and the full body it reads before acting. Build them from anywhere — Skills.load reads a directory, and a host with skills in a database constructs these directly.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:, description: "", body: "") ⇒ Skill
constructor
A new instance of Skill.
Constructor Details
#initialize(name:, description: "", body: "") ⇒ Skill
Returns a new instance of Skill.
9 10 11 12 13 |
# File 'lib/mistri/skill.rb', line 9 def initialize(name:, description: "", body: "") raise ConfigurationError, "a skill needs a name" if name.to_s.empty? super(name: name.to_s, description: description.to_s, body: body.to_s) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body
8 9 10 |
# File 'lib/mistri/skill.rb', line 8 def body @body end |
#description ⇒ Object (readonly)
Returns the value of attribute description
8 9 10 |
# File 'lib/mistri/skill.rb', line 8 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name
8 9 10 |
# File 'lib/mistri/skill.rb', line 8 def name @name end |