Sha256: 456842ee8f06d0b05657186483770c846dfc2ef9a4a85348d4cab1683818117c
Contents?: true
Size: 673 Bytes
Versions: 2
Compression:
Stored size: 673 Bytes
Contents
module CrazyHarry class Base include CrazyHarry::Default include CrazyHarry::Change include CrazyHarry::Redact include CrazyHarry::Translate include CrazyHarry::Foster include CrazyHarry::Truncate 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
crazy_harry-0.2.1 | lib/crazy_harry/base.rb |
crazy_harry-0.2.0 | lib/crazy_harry/base.rb |