File: pattern.rb

package info (click to toggle)
ruby-cairo 1.16.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,468 kB
  • sloc: ruby: 11,856; ansic: 9,835; sh: 36; makefile: 5
file content (12 lines) | stat: -rw-r--r-- 316 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
module Cairo
  class Pattern
    class << self
      def supported?(type)
        type = type.to_s.gsub(/([a-z])([A-Z])/, '\\1_\\2').downcase
        supported_predicate = "#{type}_supported?"
        return false unless respond_to?(supported_predicate)
        send(supported_predicate)
      end
    end
  end
end