Sha256: 1282cbf2afc2d711f335ee0d4ea6befdf674a178efc860b71c02243ed8e01dae

Contents?: true

Size: 421 Bytes

Versions: 16

Compression:

Stored size: 421 Bytes

Contents

module Headmin
  module Form
    class LabelView < ViewModel
      def form
        @form.object_id
      end

      def options
        keys = attributes - %i[attribute form text]
        options = to_h.slice(*keys)
        default_options.deep_merge(options)
      end

      private

      def default_options
        {
          class: "form-label",
          required: required
        }
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
headmin-0.6.3 app/models/headmin/form/label_view.rb
headmin-0.6.2 app/models/headmin/form/label_view.rb
headmin-0.6.1 app/models/headmin/form/label_view.rb
headmin-0.6.0 app/models/headmin/form/label_view.rb
headmin-0.5.9 app/models/headmin/form/label_view.rb
headmin-0.5.8 app/models/headmin/form/label_view.rb
headmin-0.5.7 app/models/headmin/form/label_view.rb
headmin-0.5.6 app/models/headmin/form/label_view.rb
headmin-0.5.5 app/models/headmin/form/label_view.rb
headmin-0.5.4 app/models/headmin/form/label_view.rb
headmin-0.5.3 app/models/headmin/form/label_view.rb
headmin-0.5.2 app/models/headmin/form/label_view.rb
headmin-0.5.1 app/models/headmin/form/label_view.rb
headmin-0.5.0 app/models/headmin/form/label_view.rb
headmin-0.4.2 app/models/headmin/form/label_view.rb
headmin-0.4.1 app/models/headmin/form/label_view.rb