Class: CrazyHarry::Base
- Inherits:
-
Object
- Object
- CrazyHarry::Base
- Defined in:
- lib/crazy_harry/base.rb
Constant Summary
Constants included from Redact
Constants included from Change
Change::BLOCK_CONVERSION_ELEMENTS
Constants included from Default
Instance Attribute Summary collapse
-
#fragment ⇒ Object
Returns the value of attribute fragment.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#steps ⇒ Object
Returns the value of attribute steps.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes included from Translate
#add_attributes, #from_text, #to_text
Attributes included from Redact
Attributes included from Change
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Base
constructor
A new instance of Base.
- #to_s ⇒ Object
Methods included from Truncate
Methods included from Foster
Methods included from Translate
Methods included from Redact
Methods included from Change
Methods included from Default
#convert_br_to_p!, #dedupe!, #no_blanks!
Constructor Details
#initialize(opts = {}) ⇒ Base
Returns a new instance of Base.
12 13 14 15 |
# File 'lib/crazy_harry/base.rb', line 12 def initialize(opts = {}) self.fragment = Loofah.fragment(opts.delete(:fragment)) if opts.has_key?(:fragment) self.steps = [] end |
Instance Attribute Details
#fragment ⇒ Object
Returns the value of attribute fragment.
10 11 12 |
# File 'lib/crazy_harry/base.rb', line 10 def fragment @fragment end |
#scope ⇒ Object
Returns the value of attribute scope.
10 11 12 |
# File 'lib/crazy_harry/base.rb', line 10 def scope @scope end |
#steps ⇒ Object
Returns the value of attribute steps.
10 11 12 |
# File 'lib/crazy_harry/base.rb', line 10 def steps @steps end |
#text ⇒ Object
Returns the value of attribute text.
10 11 12 |
# File 'lib/crazy_harry/base.rb', line 10 def text @text end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/crazy_harry/base.rb', line 17 def to_s self.fragment.to_s.squeeze(' ').strip end |