Class: ParagraphText
- Inherits:
-
Object
- Object
- ParagraphText
- Includes:
- Lengthable
- Defined in:
- lib/ipsummer/paragraph_text.rb
Instance Attribute Summary collapse
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ParagraphText
constructor
A new instance of ParagraphText.
- #text ⇒ Object
Methods included from Lengthable
#length, #length_max, #length_min, #max_no_min?, #min_and_max?, #min_no_max?
Constructor Details
#initialize(options = {}) ⇒ ParagraphText
Returns a new instance of ParagraphText.
9 10 11 12 |
# File 'lib/ipsummer/paragraph_text.rb', line 9 def initialize(={}) @min = [:min_sentences] @max = [:max_sentences] end |
Instance Attribute Details
#max ⇒ Object (readonly)
Returns the value of attribute max.
7 8 9 |
# File 'lib/ipsummer/paragraph_text.rb', line 7 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
7 8 9 |
# File 'lib/ipsummer/paragraph_text.rb', line 7 def min @min end |
Instance Method Details
#text ⇒ Object
14 15 16 |
# File 'lib/ipsummer/paragraph_text.rb', line 14 def text sentences.first(length).join('. ') + '.' end |