class Dox::Printers::ActionPrinter
Attributes
action[RW]
action_hash[RW]
Public Instance Methods
print(action)
click to toggle source
# File lib/dox/printers/action_printer.rb, line 4 def print(action) self.action = action @action_hash = find_or_add(find_or_add(spec, action.path.to_s), action.verb.downcase.to_sym) add_action add_action_params print_examples end
Private Instance Methods
add_action()
click to toggle source
# File lib/dox/printers/action_printer.rb, line 18 def add_action action_hash['summary'] = action.name action_hash['tags'] = [action.resource] action_hash['description'] = format_desc(action.desc) end
add_action_params()
click to toggle source
# File lib/dox/printers/action_printer.rb, line 24 def add_action_params return unless action.params.present? action_hash['parameters'] = action.params end
print_examples()
click to toggle source
# File lib/dox/printers/action_printer.rb, line 30 def print_examples action.examples.each do |example| ExampleRequestPrinter.new(action_hash).print(example) ExampleResponsePrinter.new(action_hash).print(example) end end