Class: Slingshot::Configuration
- Inherits:
-
Object
- Object
- Slingshot::Configuration
- Defined in:
- lib/slingshot/configuration.rb
Class Method Summary collapse
- .client(klass = nil) ⇒ Object
- .logger(device = nil, options = {}) ⇒ Object
- .reset(*properties) ⇒ Object
- .url(value = nil) ⇒ Object
- .wrapper(klass = nil) ⇒ Object
Class Method Details
.client(klass = nil) ⇒ Object
9 10 11 |
# File 'lib/slingshot/configuration.rb', line 9 def self.client(klass=nil) @client = klass || @client || Client::RestClient end |
.logger(device = nil, options = {}) ⇒ Object
17 18 19 20 |
# File 'lib/slingshot/configuration.rb', line 17 def self.logger(device=nil, ={}) return @logger = Logger.new(device, ) if device @logger || nil end |
.reset(*properties) ⇒ Object
22 23 24 25 |
# File 'lib/slingshot/configuration.rb', line 22 def self.reset(*properties) reset_variables = properties.empty? ? instance_variables : instance_variables & properties.map { |p| "@#{p}" } reset_variables.each { |v| instance_variable_set(v, nil) } end |
.url(value = nil) ⇒ Object
5 6 7 |
# File 'lib/slingshot/configuration.rb', line 5 def self.url(value=nil) @url = value || @url || "http://localhost:9200" end |