lib/soaspec.rb in soaspec-0.2.15 vs lib/soaspec.rb in soaspec-0.2.16

- old
+ new

@@ -38,54 +38,59 @@ module Soaspec @template_folder = 'templates' @auto_oauth = true class << self - # Specify whether to see params sent to and retrieved from oauth. This will put password in log file, only recommended for debugging - attr_writer :debug_oauth # Folder used to store templates for API calls + # @return [String] attr_reader :template_folder # Stores last exchange + # @return [Exchange] attr_accessor :last_exchange # Automatically add Authorization header to RestHandler where oauth2 credentials are specified + # @return [Boolean] Whether to add authorization header attr_accessor :auto_oauth # Folder used to store templates for API calls # Converts folder / folders into an array depending upon string passed def template_folder=(folder) @template_folder = folder.include?('\\') ? folder.split('\\') : folder.split('/') end - # Folder used to store credentials - # Used in auth2_file command - # @param [String] folder - attr_writer :credentials_folder - # Credentials folder used to store secret data (not in source control) E.g passwords - attr_reader :credentials_folder + # Used in oauth2_file command + # @return [String] folder in which credentials are stored + attr_accessor :credentials_folder - # Used so that exchange class knows what context it's in - # @param [ExchangeHandler] handler A class inheriting from Soaspec::ExchangeHandler. Exchange class uses this - attr_writer :api_handler + # Used so that exchange class knows what context it's in. + # @return [ExchangeHandler] handler A class inheriting from Soaspec::ExchangeHandler. Exchange class uses this + attr_accessor :api_handler - # Exchange Handler class currently being used - attr_reader :api_handler - - # Set whether to transform strings to keys in request automatically - # @param [Boolean] use_keys + # Set whether to transform strings to keys in request automatically. + # @return [Boolean] attr_writer :always_use_keys # @return [Boolean] Whether to transform strings to keys in request automatically def always_use_keys? @always_use_keys || true end # @return [Boolean] Whether to see params sent to & received from oauth URL def debug_oauth? - @debug_oauth || false + puts 'Soaspec.debug_oauth? now deprecated. Please use Soaspec::OAuth2.debug_oauth? instead' + Soaspec::OAuth2.debug_oauth? end + # Specify whether to see params sent to and retrieved from oauth. + # This will put password in log file, only recommended for debugging + # @param [String] set Whether to debug oauth + def debug_oauth=(set) + puts 'Soaspec.debug_oauth= now deprecated. Please use Soaspec::OAuth2.debug_oauth= instead' + Soaspec::OAuth2.debug_oauth = set + end + # Whether to log all API traffic + # @param [Boolean] set def log_api_traffic=(set) puts 'Soaspec.log_api_traffic= now deprecated. Please use Soaspec::SpecLogger.log_api_traffic= instead' Soaspec::SpecLogger.log_api_traffic = set end