File: enumerize.rb

package info (click to toggle)
ruby-enumerize 2.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 432 kB
  • sloc: ruby: 3,712; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 393 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module Sequel
  module Plugins
    module Enumerize
      # Depend on the def_dataset_method plugin
      def self.apply(model)
        model.plugin(:def_dataset_method) unless model.respond_to?(:def_dataset_method)
      end

      module InstanceMethods
        def self.included(base)
          base.extend ::Enumerize
        end
      end
    end
  end
end