Sha256: 01d3917274874c26cdfc005d059ff61daf0b9a7780a1eca175260d43017e20a0

Contents?: true

Size: 507 Bytes

Versions: 5

Compression:

Stored size: 507 Bytes

Contents

module YARD
    module CodeObjects
      class Base
        def restful?
          has_tag?(:restful_api)
        end
        def resource?
          meths.any?{ |m| m.has_tag?(:url) }
        end
      end
    end
end

module RestFilters

  def select_restful(list)
    (list || []).select(&:restful?)
  end

  def select_objects(list)
    select_restful(list).reject(&:resource?).sort_by(&:name)
  end

  def select_resources(list)
    select_restful(list).select(&:resource?).sort_by(&:name)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yard-restful-1.2.4 lib/yard-restful/rest_filters.rb
yard-restful-1.2.3 lib/yard-restful/rest_filters.rb
yard-restful-1.2.2 lib/yard-restful/rest_filters.rb
yard-restful-1.2.1 lib/yard-rest/rest_filters.rb
yard-restful-1.2.0 lib/yard-rest/rest_filters.rb