Class: Lipsum::AllTypes
- Inherits:
-
Object
show all
- Defined in:
- lib/lipsum.rb
Overview
Instance Method Summary
collapse
Constructor Details
#initialize(start) ⇒ AllTypes
Returns a new instance of AllTypes.
9
10
11
12
13
|
# File 'lib/lipsum.rb', line 9
def initialize(start)
@amount = 1
@what = nil
@start = start
end
|
Instance Method Details
#[](n) ⇒ Object
15
16
17
18
19
|
# File 'lib/lipsum.rb', line 15
def [](n)
@amount = n
generate
self
end
|
#to_html ⇒ Object
26
27
28
|
# File 'lib/lipsum.rb', line 26
def to_html
self.to_s.split( /\n/ ).map{ |e| "<p>#{e}</p>\n" }.join()
end
|
#to_s ⇒ Object
Also known as:
to_string
21
22
23
|
# File 'lib/lipsum.rb', line 21
def to_s
@lorem_ipsum.inner_text()
end
|