module Webspicy
Constants
- Checker
- Client
Backward compatibility
- DEFAULT_SYSTEM
- EXAMPLES_FOLDER
- FileUpload
- HttpClient
- LOGGER
Logging facade
- PASSTHROUGH_EXCEPTIONS
Exceptions that we let pass during testing
- Postcondition
- Precondition
- ROOT_FOLDER
About folders
- RackTestClient
- Resource
- Scope
- VERSION
Attributes
Public Class Methods
Returns the current scope or a default one is none has been previously installed using `set_current_scope` or `with_scope`
# File lib/webspicy.rb, line 81 def current_scope Thread.current[:webspicy_scope] || default_scope end
# File lib/webspicy.rb, line 128 def debug(*args, &bl) LOGGER && LOGGER.debug(*args, &bl) end
Returns a default scope instance.
# File lib/webspicy.rb, line 53 def default_scope Configuration::Scope.new(Configuration.new) end
# File lib/webspicy.rb, line 133 def fatal(*args, &bl) LOGGER && LOGGER.fatal(*args, &bl) end
# File lib/webspicy.rb, line 123 def info(*args, &bl) LOGGER && LOGGER.info(*args, &bl) end
Parses a webservice schema (typically input or output) in the context of the current scope previously installed using `with_scope`.
If no scope has previously been installed, Finitio's default system is used instead of another schema.
# File lib/webspicy.rb, line 104 def schema(fio) if scope = Thread.current[:webspicy_scope] scope.parse_schema(fio) else DEFAULT_SYSTEM.system(fio) end end
Sets the current scope.
This method is considered private and should not be used outside of Webspicy
itself.
# File lib/webspicy.rb, line 92 def set_current_scope(scope) Thread.current[:webspicy_scope] = scope end
Yields the block after having installed `scope` globally.
This method makes sure that the scope will also be accessible for Finitio world schema parsing/dressing. Given that some global state is required (see “Schema” ADT, the dresser in particular, which calls `schema` later), the scope is put as a thread-local variable…
This method is considered private and should not be used outside of Webspicy
itself.
# File lib/webspicy.rb, line 69 def with_scope(scope) scope = set_current_scope(scope) result = yield scope set_current_scope(nil) result end
Private Instance Methods
Returns the current scope or a default one is none has been previously installed using `set_current_scope` or `with_scope`
# File lib/webspicy.rb, line 81 def current_scope Thread.current[:webspicy_scope] || default_scope end
# File lib/webspicy.rb, line 128 def debug(*args, &bl) LOGGER && LOGGER.debug(*args, &bl) end
Returns a default scope instance.
# File lib/webspicy.rb, line 53 def default_scope Configuration::Scope.new(Configuration.new) end
# File lib/webspicy.rb, line 133 def fatal(*args, &bl) LOGGER && LOGGER.fatal(*args, &bl) end
# File lib/webspicy.rb, line 123 def info(*args, &bl) LOGGER && LOGGER.info(*args, &bl) end
Parses a webservice schema (typically input or output) in the context of the current scope previously installed using `with_scope`.
If no scope has previously been installed, Finitio's default system is used instead of another schema.
# File lib/webspicy.rb, line 104 def schema(fio) if scope = Thread.current[:webspicy_scope] scope.parse_schema(fio) else DEFAULT_SYSTEM.system(fio) end end
Sets the current scope.
This method is considered private and should not be used outside of Webspicy
itself.
# File lib/webspicy.rb, line 92 def set_current_scope(scope) Thread.current[:webspicy_scope] = scope end
Yields the block after having installed `scope` globally.
This method makes sure that the scope will also be accessible for Finitio world schema parsing/dressing. Given that some global state is required (see “Schema” ADT, the dresser in particular, which calls `schema` later), the scope is put as a thread-local variable…
This method is considered private and should not be used outside of Webspicy
itself.
# File lib/webspicy.rb, line 69 def with_scope(scope) scope = set_current_scope(scope) result = yield scope set_current_scope(nil) result end