Class: Neuron::Client::API

Inherits:
Object show all
Defined in:
lib/neuron-client/api.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.default_apiObject

Returns the value of attribute default_api.



68
69
70
# File 'lib/neuron-client/api.rb', line 68

def default_api
  @default_api
end

Instance Attribute Details

#connectionObject

Returns the value of attribute connection.



5
6
7
# File 'lib/neuron-client/api.rb', line 5

def connection
  @connection
end

Instance Method Details

#configure {|config| ... } ⇒ Object

Yields:

  • (config)


7
8
9
10
11
12
13
14
15
16
# File 'lib/neuron-client/api.rb', line 7

def configure
  yield config
  inclusion(config, :connection_type, [:admin, :membase])

  configure_admin_connection if config.connection_type == :admin
  configure_membase_connection if config.connection_type == :membase
  @validate = (config.validate != false)

  self
end

#connection_typeObject



18
19
20
# File 'lib/neuron-client/api.rb', line 18

def connection_type
  @config.connection_type
end

#validate?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/neuron-client/api.rb', line 22

def validate?
  @validate != false
end