Skip to content

Commit

Permalink
Add image_file example to Placeholdit doc
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-brousse committed May 23, 2018
1 parent 76678bb commit 882abc5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions doc/placeholdit.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
```ruby
Faker::Placeholdit.image #=> "http://placehold.it/300x300.png/000"

Faker::Placeholdit.image("50x50") #=> "http://placehold.it/50x50.png/000"
Faker::Placeholdit.image('50x50') #=> "http://placehold.it/50x50.png/000"

Faker::Placeholdit.image("50x50", 'jpg') #=> "http://placehold.it/50x50.jpg/000"
Faker::Placeholdit.image('50x50', 'jpg') #=> "http://placehold.it/50x50.jpg/000"

Faker::Placeholdit.image("50x50", 'gif', 'ffffff') #=> "http://placehold.it/50x50.gif/ffffff"
Faker::Placeholdit.image('50x50', 'gif', 'ffffff') #=> "http://placehold.it/50x50.gif/ffffff"

Faker::Placeholdit.image("50x50", 'jpeg', :random) #=> "http://placehold.it/50x50.jpeg/39eba7"
Faker::Placeholdit.image('50x50', 'jpeg', :random) #=> "http://placehold.it/50x50.jpeg/39eba7"

Faker::Placeholdit.image("50x50", 'jpeg', 'ffffff', '000') #=> "http://placehold.it/50x50.jpeg/ffffff/000"
Faker::Placeholdit.image('50x50', 'jpeg', 'ffffff', '000') #=> "http://placehold.it/50x50.jpeg/ffffff/000"

Faker::Placeholdit.image("50x50", 'jpeg', :random, :random) #=> "http://placehold.it/50x50.jpeg/d39e44/888ba7"
Faker::Placeholdit.image('50x50', 'jpeg', :random, :random) #=> "http://placehold.it/50x50.jpeg/d39e44/888ba7"

Faker::Placeholdit.image("50x50", 'jpg', 'ffffff', '000', 'Some Custom Text') #=> "http://placehold.it/50x50.jpg/ffffff/000?text='Some Custom Text'"
Faker::Placeholdit.image('50x50', 'jpg', 'ffffff', '000', 'Some Custom Text') #=> "http://placehold.it/50x50.jpg/ffffff/000?text='Some Custom Text'"

Faker::Placeholdit.image_file('50x50', 'jpg', 'ffffff', '000', 'Some Custom Text') #=> #<File:/var/folders/ds/q6bxqbjs1t5_4g9fgy_s8xrc0000gn/T/faker_placeholdit20180523-20557-10u4ct3>
```

0 comments on commit 882abc5

Please sign in to comment.