Class: NitroIntelligence::Observability::Project
- Inherits:
-
Object
- Object
- NitroIntelligence::Observability::Project
- Defined in:
- lib/nitro_intelligence/observability/project.rb
Defined Under Namespace
Classes: NotFoundError
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
readonly
Returns the value of attribute auth_token.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#prompt_store ⇒ Object
readonly
Returns the value of attribute prompt_store.
-
#public_key ⇒ Object
readonly
Returns the value of attribute public_key.
-
#secret_key ⇒ Object
readonly
Returns the value of attribute secret_key.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(slug:, id:, public_key:, secret_key:, **_kwargs) ⇒ Project
constructor
A new instance of Project.
Constructor Details
#initialize(slug:, id:, public_key:, secret_key:, **_kwargs) ⇒ Project
Returns a new instance of Project.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/nitro_intelligence/observability/project.rb', line 11 def initialize(slug:, id:, public_key:, secret_key:, **_kwargs) @slug = slug @id = id @public_key = public_key @secret_key = secret_key @auth_token = Base64.strict_encode64("#{public_key}:#{secret_key}") @prompt_store = PromptStore.new( observability_project_slug: slug, observability_public_key: public_key, observability_secret_key: secret_key ) end |
Instance Attribute Details
#auth_token ⇒ Object (readonly)
Returns the value of attribute auth_token.
9 10 11 |
# File 'lib/nitro_intelligence/observability/project.rb', line 9 def auth_token @auth_token end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/nitro_intelligence/observability/project.rb', line 9 def id @id end |
#prompt_store ⇒ Object (readonly)
Returns the value of attribute prompt_store.
9 10 11 |
# File 'lib/nitro_intelligence/observability/project.rb', line 9 def prompt_store @prompt_store end |
#public_key ⇒ Object (readonly)
Returns the value of attribute public_key.
9 10 11 |
# File 'lib/nitro_intelligence/observability/project.rb', line 9 def public_key @public_key end |
#secret_key ⇒ Object (readonly)
Returns the value of attribute secret_key.
9 10 11 |
# File 'lib/nitro_intelligence/observability/project.rb', line 9 def secret_key @secret_key end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
9 10 11 |
# File 'lib/nitro_intelligence/observability/project.rb', line 9 def slug @slug end |
Class Method Details
.find_by_slug(slug:) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/nitro_intelligence/observability/project.rb', line 24 def self.find_by_slug(slug:) project_config = NitroIntelligence.config.observability_projects.find { |project| project["slug"] == slug } return new(**project_config.to_h.transform_keys(&:to_sym)) if project_config nil end |