Class: Faker::Source
- Inherits:
-
Base
- Object
- Base
- Faker::Source
show all
- Defined in:
- lib/faker/source.rb
Constant Summary
Constants inherited
from Base
Base::Letters, Base::Numbers, Base::ULetters
Class Method Summary
collapse
Methods inherited from Base
bothify, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, respond_to_missing?, sample, shuffle, translate, unique, with_locale
Class Method Details
.hello_world(lang = :ruby) ⇒ Object
4
5
6
|
# File 'lib/faker/source.rb', line 4
def hello_world(lang = :ruby)
fetch("source.hello_world.#{lang}")
end
|
.print(str: 'some string', lang: :ruby) ⇒ Object
8
9
10
11
|
# File 'lib/faker/source.rb', line 8
def print(str: 'some string', lang: :ruby)
code = fetch("source.print.#{lang}")
code.gsub('faker_string_to_print', str)
end
|
.print_1_to_10(lang = :ruby) ⇒ Object
13
14
15
|
# File 'lib/faker/source.rb', line 13
def print_1_to_10(lang = :ruby)
fetch("source.print_1_to_10.#{lang}")
end
|