Class: Pinecone::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/pinecone.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



15
16
17
18
# File 'lib/pinecone.rb', line 15

def initialize
  @api_key = nil
  @environment = nil
end

Instance Attribute Details

#api_keyObject

Raises:



20
21
22
23
24
25
# File 'lib/pinecone.rb', line 20

def api_key
  return @api_key if @api_key

  error_text = "Pinecone API Key missing! See https://github.com/hornet-network/ruby-pinecone#usage"
  raise ConfigurationError, error_text
end

#environmentObject

Raises:



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

def environment
  return @environment if @environment

  error_text = "Pinecone environment missing! See https://github.com/hornet-network/ruby-pinecone#usage"
  raise ConfigurationError, error_text
end