Module: ActiveRestClient::Configuration::ClassMethods
- Defined in:
- lib/active_rest_client/configuration.rb
Constant Summary collapse
- @@base_url =
nil
Instance Method Summary collapse
- #_reset_configuration! ⇒ Object
- #base_url(value = nil) ⇒ Object
- #base_url=(value) ⇒ Object
- #lazy_load! ⇒ Object
- #lazy_load? ⇒ Boolean
- #proxy(value = nil) ⇒ Object
- #translator(value = nil) ⇒ Object
- #verbose(value = nil) ⇒ Object
- #verbose! ⇒ Object
- #whiny_missing(value = nil) ⇒ Object
Instance Method Details
#_reset_configuration! ⇒ Object
55 56 57 58 59 60 |
# File 'lib/active_rest_client/configuration.rb', line 55 def _reset_configuration! @base_url = nil @@base_url = nil @whiny_missing = nil @lazy_load = false end |
#base_url(value = nil) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/active_rest_client/configuration.rb', line 7 def base_url(value = nil) if value.nil? if @base_url.nil? @@base_url else @base_url end else value = value.gsub(/\/$/, '') @base_url = value end end |
#base_url=(value) ⇒ Object
20 21 22 23 24 |
# File 'lib/active_rest_client/configuration.rb', line 20 def base_url=(value) ActiveRestClient::Logger.info "\033[1;4;32m#{name}\033[0m Base URL set to be #{value}" value = value.gsub(/\/+$/, '') @@base_url = value end |
#lazy_load! ⇒ Object
26 27 28 |
# File 'lib/active_rest_client/configuration.rb', line 26 def lazy_load! @lazy_load = true end |
#lazy_load? ⇒ Boolean
30 31 32 |
# File 'lib/active_rest_client/configuration.rb', line 30 def lazy_load? @lazy_load || false end |
#proxy(value = nil) ⇒ Object
51 52 53 |
# File 'lib/active_rest_client/configuration.rb', line 51 def proxy(value = nil) value ? @proxy = value : @proxy || nil end |
#translator(value = nil) ⇒ Object
46 47 48 49 |
# File 'lib/active_rest_client/configuration.rb', line 46 def translator(value = nil) ActiveRestClient::Logger.warn("DEPRECATION: The translator functionality of ActiveRestClient has been replaced with proxy functionality, see https://github.com/whichdigital/active-rest-client#proxying-apis for more information") unless value.nil? value ? @translator = value : @translator || nil end |
#verbose(value = nil) ⇒ Object
42 43 44 |
# File 'lib/active_rest_client/configuration.rb', line 42 def verbose(value = nil) value ? @verbose = value : @verbose || false end |
#verbose! ⇒ Object
38 39 40 |
# File 'lib/active_rest_client/configuration.rb', line 38 def verbose! @verbose = true end |
#whiny_missing(value = nil) ⇒ Object
34 35 36 |
# File 'lib/active_rest_client/configuration.rb', line 34 def whiny_missing(value = nil) value ? @whiny_missing = value : @whiny_missing || false end |