Sha256: a73b7ae6bf7176455c8e202cd0359129b3bad02efa68ebf1d063f75008a9e9dd
Contents?: true
Size: 528 Bytes
Versions: 7
Compression:
Stored size: 528 Bytes
Contents
module SlideHero class Image attr_reader :location, :alt_text, :width, :height def initialize(location, alt_text="", width:nil, height:nil) @location = location @alt_text = alt_text @width = width @height = height end def compile %{<img#{width_attribute}#{height_attribute} src="images/#{location}" alt="#{alt_text}">} end def height_attribute %{ height="#{height}"} if height end def width_attribute %{ width="#{width}"} if width end end end
Version data entries
7 entries across 7 versions & 1 rubygems