Class: Khoj::Configuration

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

Defined Under Namespace

Classes: Connection

Constant Summary collapse

DEFAULTS =
{
  :api_host => 'http://localhost:9200'
}

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_hostObject

Returns the value of attribute api_host.



9
10
11
# File 'lib/khoj/configuration.rb', line 9

def api_host
  @api_host
end

.api_keyObject

Returns the value of attribute api_key.



8
9
10
# File 'lib/khoj/configuration.rb', line 8

def api_key
  @api_key
end

.validObject

Returns the value of attribute valid.



10
11
12
# File 'lib/khoj/configuration.rb', line 10

def valid
  @valid
end

Class Method Details

.connectionObject



12
13
14
# File 'lib/khoj/configuration.rb', line 12

def connection
  @connection ||= Connection.new(:url => Configuration.api_host).class
end

.valid?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/khoj/configuration.rb', line 16

def valid?
  self.valid
end