Class: DSPy::Signature::FieldDescriptor

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dspy/signature.rb

Overview

Container for field type and description

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, description = nil, has_default = false, default_value = nil) ⇒ FieldDescriptor

Returns a new instance of FieldDescriptor.



27
28
29
30
31
32
# File 'lib/dspy/signature.rb', line 27

def initialize(type, description = nil, has_default = false, default_value = nil)
  @type = type
  @description = description
  @has_default = has_default
  @default_value = default_value
end

Instance Attribute Details

#default_valueObject (readonly)

Returns the value of attribute default_value.



24
25
26
# File 'lib/dspy/signature.rb', line 24

def default_value
  @default_value
end

#descriptionObject (readonly)

Returns the value of attribute description.



18
19
20
# File 'lib/dspy/signature.rb', line 18

def description
  @description
end

#has_defaultObject (readonly)

Returns the value of attribute has_default.



21
22
23
# File 'lib/dspy/signature.rb', line 21

def has_default
  @has_default
end

#typeObject (readonly)

Returns the value of attribute type.



15
16
17
# File 'lib/dspy/signature.rb', line 15

def type
  @type
end