Sha256: 530b5ee24e3cc23ff18cdc73b228226e3b17dd6d141b9bad2b7172e9a562a1b3

Contents?: true

Size: 540 Bytes

Versions: 2

Compression:

Stored size: 540 Bytes

Contents

module Dox
  module Printers
    class ResourcePrinter < BasePrinter

      def print(resource)
        if resource.endpoint.present?
          @output.puts "\n## #{resource.name} [#{resource.endpoint}]\n\n#{print_desc(resource.desc)}\n"
        else
          @output.puts "## #{resource.name}"
        end

        resource.actions.each do |_, action|
          action_printer.print(action)
        end
      end

      private

      def action_printer
        @action_printer ||= ActionPrinter.new(@output)
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dox-0.0.3 lib/dox/printers/resource_printer.rb
dox-0.0.2 lib/dox/printers/resource_printer.rb