Class: Redaction::Types::BasicHtml

Inherits:
Base
  • Object
show all
Defined in:
lib/redaction/types/basic_html.rb

Instance Attribute Summary

Attributes inherited from Base

#data, #record

Instance Method Summary collapse

Methods inherited from Base

call, #initialize

Constructor Details

This class inherits a constructor from Redaction::Types::Base

Instance Method Details

#contentObject



6
7
8
9
10
11
# File 'lib/redaction/types/basic_html.rb', line 6

def content
  [nil, "em", "strong"].shuffle.map! do |tag|
    text = Faker::Lorem.sentence(word_count: rand(1..3)).sub(/\.$/, "")
    tag ? "<#{tag}>#{text}</#{tag}>" : text
  end.join(" ")
end