Module: Restful
- Defined in:
- lib/restful.rb,
lib/restful/version.rb,
lib/restful/serializer.rb,
lib/restful/configuration.rb
Overview
This file is part of restful_serializer. Copyright 2011 Joshua Partlow. This is free software, see the LICENSE file for details.
Defined Under Namespace
Modules: Configuration, Extensions Classes: Association, DeepHash, Serializer, Url, UrlFactory
Constant Summary collapse
- VERSION =
"0.1.5"
Class Method Summary collapse
- .clear ⇒ Object
-
.register_web_service(name, options = {}, &block) ⇒ Object
Configured the specified web service.
- .symbolized_web_service_name(name) ⇒ Object
-
.web_service_configuration(key) ⇒ Object
Retrieve configuration for the specified web service.
Class Method Details
.clear ⇒ Object
149 150 151 152 |
# File 'lib/restful.rb', line 149 def clear self. = {} self.registered_web_services = {} end |
.register_web_service(name, options = {}, &block) ⇒ Object
Configured the specified web service.
130 131 132 133 |
# File 'lib/restful.rb', line 130 def register_web_service(name, = {}, &block) @@registered_web_services[symbolized_web_service_name(name)] = new_ws = Restful::Configuration::WebService.register(name, , &block) return new_ws end |
.symbolized_web_service_name(name) ⇒ Object
144 145 146 147 |
# File 'lib/restful.rb', line 144 def symbolized_web_service_name(name) return if name.nil? name.to_s.downcase.gsub(/[^\w]+/,'_').to_sym end |
.web_service_configuration(key) ⇒ Object
Retrieve configuration for the specified web service.
136 137 138 139 140 141 142 |
# File 'lib/restful.rb', line 136 def web_service_configuration(key) ws = @@registered_web_services[symbolized_web_service_name(key)] if ws..empty? && !.empty? ws. = .dup end if ws return ws end |