Class: DummyImage::RequestParser

Inherits:
Object
  • Object
show all
Defined in:
lib/dummy_image/request_parser.rb

Instance Method Summary collapse

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

#bgcolorObject



24
25
26
# File 'lib/dummy_image/request_parser.rb', line 24

def bgcolor
  @bgcolor ||= valid_color(arguments[3]) || "CCCCCC"
end

#fgcolorObject



20
21
22
# File 'lib/dummy_image/request_parser.rb', line 20

def fgcolor
  @fgcolor ||= valid_color(arguments[2]) || "333333"
end

#formatObject



8
9
10
# File 'lib/dummy_image/request_parser.rb', line 8

def format
  valid_format @format
end

#heightObject



12
13
14
# File 'lib/dummy_image/request_parser.rb', line 12

def height
  @height ||= valid_size(arguments[0]) || "300"
end

#widthObject



16
17
18
# File 'lib/dummy_image/request_parser.rb', line 16

def width
  @width ||= valid_size(arguments[1]) || height
end