Class: DatagroutConduit::Tool
- Inherits:
-
Struct
- Object
- Struct
- DatagroutConduit::Tool
- Defined in:
- lib/datagrout_conduit/types.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
Returns the value of attribute annotations.
-
#description ⇒ Object
Returns the value of attribute description.
-
#input_schema ⇒ Object
Returns the value of attribute input_schema.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Attribute Details
#annotations ⇒ Object
Returns the value of attribute annotations
4 5 6 |
# File 'lib/datagrout_conduit/types.rb', line 4 def annotations @annotations end |
#description ⇒ Object
Returns the value of attribute description
4 5 6 |
# File 'lib/datagrout_conduit/types.rb', line 4 def description @description end |
#input_schema ⇒ Object
Returns the value of attribute input_schema
4 5 6 |
# File 'lib/datagrout_conduit/types.rb', line 4 def input_schema @input_schema end |
#name ⇒ Object
Returns the value of attribute name
4 5 6 |
# File 'lib/datagrout_conduit/types.rb', line 4 def name @name end |
Class Method Details
.from_hash(hash) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/datagrout_conduit/types.rb', line 5 def self.from_hash(hash) hash = normalize_keys(hash) new( name: hash[:name], description: hash[:description], input_schema: hash[:input_schema] || hash[:inputschema], annotations: hash[:annotations] ) end |
.normalize_keys(hash) ⇒ Object
15 16 17 18 19 |
# File 'lib/datagrout_conduit/types.rb', line 15 def self.normalize_keys(hash) hash.each_with_object({}) do |(k, v), memo| memo[k.to_s.downcase.to_sym] = v end end |