Class: Linker
- Inherits:
-
Object
- Object
- Linker
- Defined in:
- lib/ipsummer/linker.rb
Instance Attribute Summary collapse
-
#paragraph_text ⇒ Object
Returns the value of attribute paragraph_text.
-
#wrapper ⇒ Object
Returns the value of attribute wrapper.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Linker
constructor
A new instance of Linker.
- #linked_paragraph ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Linker
Returns a new instance of Linker.
4 5 6 7 |
# File 'lib/ipsummer/linker.rb', line 4 def initialize(={}) @paragraph_text = [:paragraph_text] @wrapper = [:wrapper] end |
Instance Attribute Details
#paragraph_text ⇒ Object
Returns the value of attribute paragraph_text.
2 3 4 |
# File 'lib/ipsummer/linker.rb', line 2 def paragraph_text @paragraph_text end |
#wrapper ⇒ Object
Returns the value of attribute wrapper.
2 3 4 |
# File 'lib/ipsummer/linker.rb', line 2 def wrapper @wrapper end |
Instance Method Details
#linked_paragraph ⇒ Object
9 10 11 |
# File 'lib/ipsummer/linker.rb', line 9 def linked_paragraph phrases.map { |phrase| phrase_with_link phrase }.join(' ').gsub(/\w\z/, 't.') end |