class Locomotive::Steam::Liquid::Drops::SectionImagePickerField
Drop representing the valud of an image picker. It holds extra attributes like: the width, height, format and cropped of the image
Public Class Methods
new(url_or_attributes)
click to toggle source
# File lib/locomotive/steam/liquid/drops/section_content_proxy.rb, line 50 def initialize(url_or_attributes) if url_or_attributes.is_a?(String) || url_or_attributes.blank? @attributes = { source: url_or_attributes } else @attributes = url_or_attributes.symbolize_keys || {} end end
Public Instance Methods
cropped()
click to toggle source
# File lib/locomotive/steam/liquid/drops/section_content_proxy.rb, line 70 def cropped @attributes[:cropped] end
height()
click to toggle source
# File lib/locomotive/steam/liquid/drops/section_content_proxy.rb, line 66 def height @attributes[:height] end
present?()
click to toggle source
# File lib/locomotive/steam/liquid/drops/section_content_proxy.rb, line 74 def present? self.source.present? end
source()
click to toggle source
# File lib/locomotive/steam/liquid/drops/section_content_proxy.rb, line 58 def source @attributes[:source] end
to_s()
click to toggle source
# File lib/locomotive/steam/liquid/drops/section_content_proxy.rb, line 78 def to_s self.cropped || self.source || '' end
width()
click to toggle source
# File lib/locomotive/steam/liquid/drops/section_content_proxy.rb, line 62 def width @attributes[:width] end