Class: SentinelRb::Analyzers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/sentinel_rb/analyzers/base.rb

Overview

Base class for all prompt analyzers

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prompt, config, client) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
# File 'lib/sentinel_rb/analyzers/base.rb', line 9

def initialize(prompt, config, client)
  @prompt = prompt
  @config = config
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



7
8
9
# File 'lib/sentinel_rb/analyzers/base.rb', line 7

def client
  @client
end

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/sentinel_rb/analyzers/base.rb', line 7

def config
  @config
end

#promptObject (readonly)

Returns the value of attribute prompt.



7
8
9
# File 'lib/sentinel_rb/analyzers/base.rb', line 7

def prompt
  @prompt
end

Instance Method Details

#callArray<Hash>

Abstract method: Perform analysis on the prompt

Returns:

  • (Array<Hash>)

    Array of findings with :id, :level, :message keys

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/sentinel_rb/analyzers/base.rb', line 17

def call
  raise NotImplementedError, "Subclasses must implement #call"
end