module Faker::Buront

Constants

VERSION

Public Class Methods

keys() click to toggle source
# File lib/faker/buront.rb, line 41
def self.keys
  saying_hash.keys
end
part_of_saying(key) click to toggle source
# File lib/faker/buront.rb, line 25
def self.part_of_saying(key)
  whole_saying(key).random_body_oneline
end
random_part_of_saying() click to toggle source
# File lib/faker/buront.rb, line 8
def self.random_part_of_saying
  random_whole_saying.body_array.sample
end
random_saying() click to toggle source
# File lib/faker/buront.rb, line 16
def self.random_saying
  random_whole_saying.oneline
end
random_saying_title() click to toggle source
# File lib/faker/buront.rb, line 12
def self.random_saying_title
  random_whole_saying.title
end
random_whole_saying() click to toggle source
# File lib/faker/buront.rb, line 20
def self.random_whole_saying
  random_title = keys.sample
  whole_saying(random_title)
end
saying(key) click to toggle source
# File lib/faker/buront.rb, line 33
def self.saying(key)
  whole_saying(key).oneline
end
saying_title(key) click to toggle source
# File lib/faker/buront.rb, line 29
def self.saying_title(key)
  whole_saying(key).title
end
whole_saying(key) click to toggle source
# File lib/faker/buront.rb, line 37
def self.whole_saying(key)
  Faker::Buront::Saying.new(title: saying_hash[key][:title], body: saying_hash[key][:body])
end

Private Class Methods

saying_hash() click to toggle source
# File lib/faker/buront.rb, line 47
def self.saying_hash
  saying_file = "#{File.dirname(__FILE__)}/../../config/saying.yml"
  @saying_hash ||= YAML.load_file(saying_file).deep_symbolize_keys
end