Class: DummyImage::RequestParser
- Inherits:
-
Object
- Object
- DummyImage::RequestParser
- Defined in:
- lib/dummy_image/request_parser.rb
Instance Method Summary collapse
- #bgcolor ⇒ Object
- #fgcolor ⇒ Object
- #format ⇒ Object
- #height ⇒ Object
-
#initialize(path) ⇒ RequestParser
constructor
A new instance of RequestParser.
- #width ⇒ Object
Constructor Details
#initialize(path) ⇒ RequestParser
Returns a new instance of RequestParser.
4 5 6 |
# File 'lib/dummy_image/request_parser.rb', line 4 def initialize(path) @path, @format = path.split(".", 2) end |
Instance Method Details
#bgcolor ⇒ Object
24 25 26 |
# File 'lib/dummy_image/request_parser.rb', line 24 def bgcolor @bgcolor ||= valid_color(arguments[3]) || "CCCCCC" end |
#fgcolor ⇒ Object
20 21 22 |
# File 'lib/dummy_image/request_parser.rb', line 20 def fgcolor @fgcolor ||= valid_color(arguments[2]) || "333333" end |
#format ⇒ Object
8 9 10 |
# File 'lib/dummy_image/request_parser.rb', line 8 def format valid_format @format end |
#height ⇒ Object
12 13 14 |
# File 'lib/dummy_image/request_parser.rb', line 12 def height @height ||= valid_size(arguments[0]) || "300" end |
#width ⇒ Object
16 17 18 |
# File 'lib/dummy_image/request_parser.rb', line 16 def width @width ||= valid_size(arguments[1]) || height end |