Class: Workarea::Catalog::ProductImage
Instance Method Summary
collapse
#releasable?
assert_valid_config!, async, disable, enable, inline, #run_callbacks
#embedded_children
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
60
61
62
|
# File 'app/models/workarea/catalog/product_image.rb', line 60
def method_missing(sym, *args, &block)
image.send(sym, *args, &block) if image.respond_to?(sym)
end
|
Instance Method Details
#image_inverse_aspect_ratio ⇒ Object
51
52
53
54
|
# File 'app/models/workarea/catalog/product_image.rb', line 51
def image_inverse_aspect_ratio
return if image_aspect_ratio.blank? || image_aspect_ratio.zero?
1 / image_aspect_ratio.to_f
end
|
#placeholder? ⇒ Boolean
47
48
49
|
# File 'app/models/workarea/catalog/product_image.rb', line 47
def placeholder?
false
end
|
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
56
57
58
|
# File 'app/models/workarea/catalog/product_image.rb', line 56
def respond_to_missing?(method_name, include_private = false)
super || image.respond_to?(method_name)
end
|
#valid? ⇒ Boolean
42
43
44
45
|
# File 'app/models/workarea/catalog/product_image.rb', line 42
def valid?(*)
self.position ||= _parent.images.length - 1
super
end
|