Class: LoremIpsumAmet::Word

Inherits:
Object
  • Object
show all
Defined in:
lib/lorem_ipsum_amet/word.rb

Instance Method Summary collapse

Constructor Details

#initialize(base, words, join_element) ⇒ Word

Returns a new instance of Word.



4
5
6
7
8
# File 'lib/lorem_ipsum_amet/word.rb', line 4

def initialize(base, words, join_element)
  @base = base
  @words = words
  @join_element = join_element
end

Instance Method Details

#textObject



10
11
12
# File 'lib/lorem_ipsum_amet/word.rb', line 10

def text
  joined_text.gsub(/\s+\$JOIN\s+/, join_element)
end