Class: PromptSpec
- Inherits:
-
Object
- Object
- PromptSpec
- Defined in:
- lib/promptspec.rb
Defined Under Namespace
Classes: EndpointError, Error, FileNotFoundError, ParseError, RequiredParameterError
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#validate_required_params ⇒ Object
readonly
Returns the value of attribute validate_required_params.
Instance Method Summary collapse
- #call(**parameters) ⇒ Object
-
#initialize(file_path, validate_required_params: true) ⇒ PromptSpec
constructor
A new instance of PromptSpec.
Constructor Details
#initialize(file_path, validate_required_params: true) ⇒ PromptSpec
Returns a new instance of PromptSpec.
17 18 19 20 21 |
# File 'lib/promptspec.rb', line 17 def initialize(file_path, validate_required_params: true) @file_path = file_path @validate_required_params = validate_required_params load_parse_file! end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
15 16 17 |
# File 'lib/promptspec.rb', line 15 def file_path @file_path end |
#validate_required_params ⇒ Object (readonly)
Returns the value of attribute validate_required_params.
15 16 17 |
# File 'lib/promptspec.rb', line 15 def validate_required_params @validate_required_params end |
Instance Method Details
#call(**parameters) ⇒ Object
23 24 25 26 27 |
# File 'lib/promptspec.rb', line 23 def call(**parameters) validate_required_inputs!(parameters) if validate_required_params (parameters) construct_endpoint_request end |