Class: BundlerSkills::DiscoveredSkill
- Inherits:
-
Object
- Object
- BundlerSkills::DiscoveredSkill
- Defined in:
- lib/bundler_skills/discovered_skill.rb
Overview
One skill found inside a dependency gem.
source_path : absolute path to the directory containing SKILL.md link_name : symlink basename, “gem-<gem>–<skill>” (double-hyphen boundary
so a gem name containing single hyphens stays unambiguous)
Constant Summary collapse
- LINK_PREFIX =
"gem-"- BOUNDARY =
"--"
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
readonly
Returns the value of attribute gem_name.
-
#skill_name ⇒ Object
readonly
Returns the value of attribute skill_name.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(gem_name:, skill_name:, source_path:) ⇒ DiscoveredSkill
constructor
A new instance of DiscoveredSkill.
- #link_name ⇒ Object
Constructor Details
#initialize(gem_name:, skill_name:, source_path:) ⇒ DiscoveredSkill
Returns a new instance of DiscoveredSkill.
15 16 17 18 19 |
# File 'lib/bundler_skills/discovered_skill.rb', line 15 def initialize(gem_name:, skill_name:, source_path:) @gem_name = gem_name @skill_name = skill_name @source_path = source_path end |
Instance Attribute Details
#gem_name ⇒ Object (readonly)
Returns the value of attribute gem_name.
13 14 15 |
# File 'lib/bundler_skills/discovered_skill.rb', line 13 def gem_name @gem_name end |
#skill_name ⇒ Object (readonly)
Returns the value of attribute skill_name.
13 14 15 |
# File 'lib/bundler_skills/discovered_skill.rb', line 13 def skill_name @skill_name end |
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
13 14 15 |
# File 'lib/bundler_skills/discovered_skill.rb', line 13 def source_path @source_path end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
25 26 27 28 29 30 |
# File 'lib/bundler_skills/discovered_skill.rb', line 25 def ==(other) other.is_a?(DiscoveredSkill) && gem_name == other.gem_name && skill_name == other.skill_name && source_path == other.source_path end |
#hash ⇒ Object
33 34 35 |
# File 'lib/bundler_skills/discovered_skill.rb', line 33 def hash [gem_name, skill_name, source_path].hash end |
#link_name ⇒ Object
21 22 23 |
# File 'lib/bundler_skills/discovered_skill.rb', line 21 def link_name "#{LINK_PREFIX}#{gem_name}#{BOUNDARY}#{skill_name}" end |