Sha256: 5dc144453c43153a13f2578e95473ecb4b0c628544cfdd95cf9ec1191a0de02d

Contents?: true

Size: 431 Bytes

Versions: 2

Compression:

Stored size: 431 Bytes

Contents

module SlideHero
  class Image
    include Compilable
    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 height_attribute
      %{ height="#{height}"} if height
    end

    def width_attribute
      %{ width="#{width}"} if width
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slide_hero-0.0.11 lib/slide_hero/image.rb
slide_hero-0.0.10 lib/slide_hero/image.rb