Class: Cadenya::Types::CallableTool_Tool

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type: nil, tool: nil) ⇒ CallableTool_Tool

Returns a new instance of CallableTool_Tool.



8964
8965
8966
8967
# File 'lib/cadenya/types.rb', line 8964

def initialize(type: nil, tool: nil)
  @type = type
  @tool = tool
end

Instance Attribute Details

#toolObject (readonly)

Returns the value of attribute tool.



8962
8963
8964
# File 'lib/cadenya/types.rb', line 8962

def tool
  @tool
end

#typeObject (readonly)

Returns the value of attribute type.



8962
8963
8964
# File 'lib/cadenya/types.rb', line 8962

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8969
8970
8971
8972
8973
8974
# File 'lib/cadenya/types.rb', line 8969

def self.from_json(data)
  new(
    type: data["type"],
    tool: data["tool"].nil? ? nil : Types::ResourceMetadata.from_json(data["tool"]),
  )
end

Instance Method Details

#to_hObject



8976
8977
8978
8979
8980
8981
# File 'lib/cadenya/types.rb', line 8976

def to_h
  {
    type: Util.plain(@type),
    tool: Util.plain(@tool),
  }.reject { |_k, v| v.nil? }
end