Class: Faker::Book

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/books/book.rb

Constant Summary

Constants inherited from Base

Faker::Base::LLetters, Faker::Base::Letters, Faker::Base::NOT_GIVEN, Faker::Base::Numbers, Faker::Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.authorString

Produces a random book author

Examples:

Faker::Book.author #=> "Alysha Olsen"

Returns:

  • (String)

Available since:

  • 1.9.3


30
31
32
# File 'lib/faker/books/book.rb', line 30

def author
  parse('book.author')
end

.genreString

Produces a random genre

Examples:

Faker::Book.genre #=> "Mystery"

Returns:

  • (String)

Available since:

  • 1.9.3


56
57
58
# File 'lib/faker/books/book.rb', line 56

def genre
  fetch('book.genre')
end

.publisherString

Produces a random book publisher

Examples:

Faker::Book.publisher #=> "Opus Reader"

Returns:

  • (String)

Available since:

  • 1.9.3


43
44
45
# File 'lib/faker/books/book.rb', line 43

def publisher
  fetch('book.publisher')
end

.titleString

Produces a random book title

Examples:

Faker::Book.title #=> "The Odd Sister"

Returns:

  • (String)

Available since:

  • 1.9.3


17
18
19
# File 'lib/faker/books/book.rb', line 17

def title
  fetch('book.title')
end