Sha256: a06f0e20a5a6e24f1b4262c187f2fd006a4edd07507e67f9af0f3ae5ef15d216

Contents?: true

Size: 803 Bytes

Versions: 2

Compression:

Stored size: 803 Bytes

Contents

module LatoCore

  class Elements::Title::Cell < Cell

    @@requested_args = [:label]

    @@default_args = {
      size: 1
    }

    def initialize(args = {})
      @args = validate_args(
        args: args,
        requested_args: @@requested_args,
        default_args: @@default_args
      )

      set_conditions
    end

    def show
      render 'show.html'
    end

    private

      def set_conditions
        @html_tag = get_html_tag
      end
      
      def get_html_tag
        case @args[:size]
        when 1
          return 'h1'
        when 2
          return 'h2'
        when 3
          return 'h3'
        when 4
          return 'h4'
        when 5
          return 'h5'
        when 6
          return 'h6'
        else
          return 'h1'
        end
      end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lato_core-2.1.1 app/cells/lato_core/elements/title/cell.rb
lato_core-2.1 app/cells/lato_core/elements/title/cell.rb