Module: EasyTalk::Model::InstanceMethods
- Includes:
- SchemaBase::InstanceMethods
- Defined in:
- lib/easy_talk/model.rb
Overview
Instance methods mixed into models that include EasyTalk::Model
Instance Method Summary collapse
- #==(other) ⇒ Object included from SchemaBase::InstanceMethods
- #as_json(_options = {}) ⇒ Object included from SchemaBase::InstanceMethods
- #initialize(attributes = {}) ⇒ Object
- #method_missing(method_name, *args) ⇒ Object included from SchemaBase::InstanceMethods
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean included from SchemaBase::InstanceMethods
- #to_h ⇒ Object included from SchemaBase::InstanceMethods
- #to_hash ⇒ Object included from SchemaBase::InstanceMethods
-
#to_json_schema ⇒ Hash
Returns a Hash representing the schema in a format compatible with RubyLLM.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class EasyTalk::SchemaBase::InstanceMethods
Instance Method Details
#==(other) ⇒ Object Originally defined in module SchemaBase::InstanceMethods
#as_json(_options = {}) ⇒ Object Originally defined in module SchemaBase::InstanceMethods
#initialize(attributes = {}) ⇒ Object
59 60 61 62 63 64 65 66 |
# File 'lib/easy_talk/model.rb', line 59 def initialize(attributes = {}) @additional_properties = {} provided_keys = attributes.keys.to_set(&:to_sym) super # Perform initial mass assignment via ActiveModel::API initialize_schema_properties(provided_keys) end |
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean Originally defined in module SchemaBase::InstanceMethods
#to_h ⇒ Object Originally defined in module SchemaBase::InstanceMethods
#to_hash ⇒ Object Originally defined in module SchemaBase::InstanceMethods
#to_json_schema ⇒ Hash
Returns a Hash representing the schema in a format compatible with RubyLLM. Delegates to the class method. Required for RubyLLM's with_schema method.
72 73 74 |
# File 'lib/easy_talk/model.rb', line 72 def to_json_schema self.class.to_json_schema end |