Class: RailsAgents::Skill

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_agents/skill.rb

Constant Summary collapse

SERVER =
:server
PORTABLE =
:portable
ANTHROPIC_DOCUMENT =
:anthropic_document

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, kind:, anthropic_tool: nil, anthropic_skill: nil, requires: [], portable_tool: nil) ⇒ Skill

Returns a new instance of Skill.



11
12
13
14
15
16
17
18
# File 'lib/rails_agents/skill.rb', line 11

def initialize(name:, kind:, anthropic_tool: nil, anthropic_skill: nil, requires: [], portable_tool: nil)
  @name = name.to_sym
  @kind = kind
  @anthropic_tool = anthropic_tool
  @anthropic_skill = anthropic_skill
  @requires = requires.map(&:to_sym)
  @portable_tool = portable_tool
end

Instance Attribute Details

#anthropic_skillObject (readonly)

Returns the value of attribute anthropic_skill.



9
10
11
# File 'lib/rails_agents/skill.rb', line 9

def anthropic_skill
  @anthropic_skill
end

#anthropic_toolObject (readonly)

Returns the value of attribute anthropic_tool.



9
10
11
# File 'lib/rails_agents/skill.rb', line 9

def anthropic_tool
  @anthropic_tool
end

#kindObject (readonly)

Returns the value of attribute kind.



9
10
11
# File 'lib/rails_agents/skill.rb', line 9

def kind
  @kind
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/rails_agents/skill.rb', line 9

def name
  @name
end

#portable_toolObject (readonly)

Returns the value of attribute portable_tool.



9
10
11
# File 'lib/rails_agents/skill.rb', line 9

def portable_tool
  @portable_tool
end

#requiresObject (readonly)

Returns the value of attribute requires.



9
10
11
# File 'lib/rails_agents/skill.rb', line 9

def requires
  @requires
end

Instance Method Details

#anthropic_document?Boolean

Returns:

  • (Boolean)


22
# File 'lib/rails_agents/skill.rb', line 22

def anthropic_document? = kind == ANTHROPIC_DOCUMENT

#portable?Boolean

Returns:

  • (Boolean)


21
# File 'lib/rails_agents/skill.rb', line 21

def portable? = kind == PORTABLE

#server?Boolean

Returns:

  • (Boolean)


20
# File 'lib/rails_agents/skill.rb', line 20

def server? = kind == SERVER