Module: Swiftype::Configuration
- Included in:
- Swiftype
- Defined in:
- lib/swiftype/configuration.rb
Constant Summary collapse
- DEFAULT_ENDPOINT =
"http://api.swiftype.com/api/v1/"
- DEFAULT_USER_AGENT =
"Swiftype-Ruby/#{Swiftype::VERSION}"
- VALID_OPTIONS_KEYS =
[ :username, :password, :api_key, :user_agent, :endpoint ]
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(base) ⇒ Object
18 19 20 |
# File 'lib/swiftype/configuration.rb', line 18 def self.extended(base) base.reset end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
31 32 33 34 |
# File 'lib/swiftype/configuration.rb', line 31 def configure yield self self end |
#options ⇒ Object
36 37 38 39 40 |
# File 'lib/swiftype/configuration.rb', line 36 def = {} VALID_OPTIONS_KEYS.each{|k| [k] = send(k)} end |
#reset ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/swiftype/configuration.rb', line 22 def reset self.username = nil self.password = nil self.api_key = nil self.endpoint = DEFAULT_ENDPOINT self.user_agent = DEFAULT_USER_AGENT self end |