module Secrett11tto::Utils

Constants

ALL_VOCABULARY
CSS_VOCABULARY

Public Class Methods

css() click to toggle source
# File lib/secrett11tto.rb, line 17
def Utils.css
  [
    "position: absolute",
    "top: -#{rand(100_000..500_000)}px",
    "left: -#{rand(100_000..500_000)}px",
    # "width: 0",
    # "height: 0",
    # "display: inline"
  ].shuffle.join(";")
end
css_klass(klass) click to toggle source
# File lib/secrett11tto.rb, line 28
def Utils.css_klass(klass)
  " .#{klass} { #{css} }"
end
klass_name(len = 5..15) click to toggle source
# File lib/secrett11tto.rb, line 13
def Utils.klass_name(len = 5..15)
  ('A'..'Z').to_a.sample + CSS_VOCABULARY.sample(len.to_a.sample).join
end
tag() click to toggle source
# File lib/secrett11tto.rb, line 9
def Utils.tag
  ['i', 'span', 'em', 'small', 'sup'].sample
end