Class: SwaggerYard::Handlers::DSLHandler
- Inherits:
-
YARD::Handlers::Ruby::Base
- Object
- YARD::Handlers::Ruby::Base
- SwaggerYard::Handlers::DSLHandler
- Includes:
- YARD::CodeObjects
- Defined in:
- lib/swagger_yard/handlers.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.method_options ⇒ Object
6 7 8 |
# File 'lib/swagger_yard/handlers.rb', line 6 def self. @method_options ||= {} end |
.register_dsl_method(name, options = {}) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/swagger_yard/handlers.rb', line 18 def self.register_dsl_method(name, = {}) return if self.[name.to_s] [:args] ||= 0..-1 self.[name.to_s] = handles method_call(name) end |
.reset ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/swagger_yard/handlers.rb', line 10 def self.reset .keys.each do |m| handler = handlers.detect { |h| h.respond_to?(:name) && h.send(:name).to_s == m.to_s } handlers.delete handler if handler end .clear end |
Instance Method Details
#process ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/swagger_yard/handlers.rb', line 25 def process = self.class.[caller_method] return unless call_params[[:args]].each do |method_name| object = MethodObject.new(namespace, method_name, scope) object.signature = "def #{method_name}" register(object) end end |