Sha256: 5a7479e0c6b714ca73f244413072ea01ab7bc7dc505065fdef85d8722fcace38

Contents?: true

Size: 689 Bytes

Versions: 2

Compression:

Stored size: 689 Bytes

Contents

module LatoView
  class Component::Button::Cell < Cell

    @@colors = %w(normal yellow green red)
    @@sizes = %w(normal small)

    attr_accessor :title, :url, :color, :size

    def initialize(title: '', url: '', color: 'normal', size: 'normal')
     # save params
      @title = title
      @url = url
      @color = color
      @size = size
      # check params
      check_params
    end

    def show
      render 'show.html'
    end

    # check params
    private def check_params
      raise 'Button Cell: color value in not correct' unless @@colors.include? @color.to_s
      raise 'Button Cell: size value in not correct' unless @@sizes.include? @size.to_s
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lato_view-1.1.4 app/cells/lato_view/component/button/cell.rb
lato_view-1.1.3 app/cells/lato_view/component/button/cell.rb