Module: Upworthy
- Defined in:
- lib/upworthy.rb
Overview
Namespace for constants and methods needed to generate headlines.
Class Method Summary collapse
-
.headline ⇒ String
Generates a new clickbait headline.
Class Method Details
.headline ⇒ String
Generates a new clickbait headline.
403 404 405 406 407 |
# File 'lib/upworthy.rb', line 403 def self.headline content = Hash[CONTENT.map { |k, v| [k, v.sample] }] (HEADLINES.sample % content).gsub(" ", " ") end |