Class: ThumbnailSpecs

Inherits:
Array
  • Object
show all
Defined in:
lib/httpthumbnailer/thumbnail_specs.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_string(specs) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/httpthumbnailer/thumbnail_specs.rb', line 2

def self.from_string(specs)
	ts = ThumbnailSpecs.new
	specs.split('/').each do |spec|
		ts << ThumbnailSpec.from_string(spec)
	end
	ts
end

Instance Method Details

#max_heightObject



17
18
19
20
21
22
# File 'lib/httpthumbnailer/thumbnail_specs.rb', line 17

def max_height
	map do |spec|
		return nil unless spec.height.is_a? Integer
		spec.height
	end.max
end

#max_widthObject



10
11
12
13
14
15
# File 'lib/httpthumbnailer/thumbnail_specs.rb', line 10

def max_width
	map do |spec|
		return nil unless spec.width.is_a? Integer
		spec.width
	end.max
end