Class: LoremImageWare::LoremPixelProvider
- Inherits:
-
Object
- Object
- LoremImageWare::LoremPixelProvider
- Defined in:
- lib/lorem-image-ware.rb
Instance Method Summary collapse
-
#initialize(grayscale = false) ⇒ LoremPixelProvider
constructor
A new instance of LoremPixelProvider.
- #url(params) ⇒ Object
Constructor Details
#initialize(grayscale = false) ⇒ LoremPixelProvider
Returns a new instance of LoremPixelProvider.
7 8 9 |
# File 'lib/lorem-image-ware.rb', line 7 def initialize(grayscale = false) @grayscale = grayscale end |
Instance Method Details
#url(params) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/lorem-image-ware.rb', line 11 def url(params) type = params[:type] || "abstract" [ "http://lorempixel.com", @grayscale ? "g" : nil, params[:width], params[:height], type, "?r=#{rand(20)}" ].compact.join("/") end |