Sha256: 1d9a1d2fa5c8996321379dff15774067f7f33a20edb9b65e79b2170847f37046

Contents?: true

Size: 640 Bytes

Versions: 1

Compression:

Stored size: 640 Bytes

Contents

module CrazyHarry
  class Base
    include CrazyHarry::Default
    include CrazyHarry::Change
    include CrazyHarry::Redact
    include CrazyHarry::Translate
    include CrazyHarry::Foster

    attr_accessor :fragment, :scope, :steps, :text

    def initialize(opts = {})
      self.fragment = Loofah.fragment(opts.delete(:fragment)) if opts.has_key?(:fragment)
      self.steps = []
    end

    def to_s
      self.fragment.to_s.squeeze(' ').strip
    end

    private

    def run!
      steps.compact.delete_if do |step|
        if steps.size > 0
          fragment.scrub!(step)
          true
        end
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crazy_harry-0.1.2 lib/crazy_harry/base.rb