Sha256: 8b716cccb799f9ac732adb2f0a1c754d57ab9383f4a0a642f66e4be12c611906

Contents?: true

Size: 564 Bytes

Versions: 5

Compression:

Stored size: 564 Bytes

Contents

module ActsAsScrubbable
  module Scrubbable


    def scrubbable?
      false
    end


    def acts_as_scrubbable(*scrubbable_fields, **mapped_fields)

      class_attribute :scrubbable_fields

      self.scrubbable_fields = {}
      scrubbable_fields.each do |_field|
        self.scrubbable_fields[_field] = _field
      end

      mapped_fields.each do |_field|
        self.scrubbable_fields[_field.first] = _field.last
      end

      class_eval do

        def self.scrubbable?
          true
        end

      end

      include Scrub
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
acts_as_scrubbable-0.1.4 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.1.3 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.1.2 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.1.1 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.1.0 lib/acts_as_scrubbable/scrubbable.rb