Sha256: aa3f3282ccd8d465b03c6fb37f45610dd1c2aa1312f9efea25383e4efc68b0ac
Contents?: true
Size: 883 Bytes
Versions: 13
Compression:
Stored size: 883 Bytes
Contents
# frozen_string_literal: true module UiBibz module ViewObjects class GlyphComponentViewObject attr_accessor :options, :content def initialize(options, content = nil) @options = options @content = content end def render UiBibz::Ui::Core::Icons::Glyph.new(glyph_options[:name], mute_glyph_option).render if glyph_options[:name].present? end private def glyph_options if options[:glyph].is_a?(Hash) options[:glyph] elsif options[:glyph] { name: options[:glyph] } else {} end end def mute_glyph_option glyph_options.tap do |h| h[:text] = options[:text] h[:label] = options[:label] || content h[:shortcut] = options[:shortcut] unless options[:shortcut].nil? end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems