Sha256: 35c9eec696983f271749a1c1d81570a0a38149490908b189096ca53dcf91a1f2

Contents?: true

Size: 719 Bytes

Versions: 1

Compression:

Stored size: 719 Bytes

Contents

# Faker::Source
Need to generate a code sample for something? Just give me the language (defaults to `ruby`, obviously).

```ruby
# Keyword arguments: lang
Faker::Source.hello_world #=> "print 'Hello World!'"
Faker::Source.hello_world(lang: :javascript) #=> "alert('Hello World!');"

# Keyword arguments: str, lang
Faker::Source.print #=> "print 'some string'"
Faker::Source.print(str: 'cake') #=> "print 'cake'"
Faker::Source.print(str: 'cake', lang: :javascript) #=> "console.log('cake');"

# Keyword arguments: lang
Faker::Source.print_1_to_10 <<-DOC=> "
  10.times do |i|
    print i
  end"
DOC
Faker::Source.print_1_to_10(lang: :javascript) <<-DOC=> "
  for (let i=0; i<10; i++) {
    console.log(i);
  }"
DOC
```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/bundler/gems/faker-e1bd4a5a5777/doc/default/source.md