Module: FFaker::Book
Instance Method Summary
collapse
const_missing, k, underscore
#fetch_sample, #rand, #shuffle
Instance Method Details
#author ⇒ Object
19
20
21
|
# File 'lib/ffaker/book.rb', line 19
def author
FFaker::Name.name
end
|
#cover(slug = nil, size = '300x300', format = 'png', bgset = nil) ⇒ Object
31
32
33
|
# File 'lib/ffaker/book.rb', line 31
def cover(slug = nil, size = '300x300', format = 'png', bgset = nil)
FFaker::Avatar.image(slug, size, format, bgset)
end
|
#description(sentence_count = 3) ⇒ Object
27
28
29
|
# File 'lib/ffaker/book.rb', line 27
def description(sentence_count = 3)
FFaker::Lorem.paragraph(sentence_count)
end
|
#genre ⇒ Object
15
16
17
|
# File 'lib/ffaker/book.rb', line 15
def genre
fetch_sample(GENRES)
end
|
#isbn ⇒ Object
23
24
25
|
# File 'lib/ffaker/book.rb', line 23
def isbn
(rand(24_000_000_000) + 1_000_000_000).to_s
end
|
#title ⇒ Object
8
9
10
11
12
13
|
# File 'lib/ffaker/book.rb', line 8
def title
case rand(2)
when 0 then simple_title
when 1 then title_with_prefix
end
end
|