Module: PrimeAwesome::LabelDrawElement

Defined in:
lib/prime_awesome/draw_label.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/prime_awesome/draw_label.rb', line 4

def self.included(base)
  base.class_eval do
    def computed_options
      @computed_options || begin
        super
        icon = computed_options[:fa_icon]
        @computed_options.merge!({
          text: MotionAwesome.hex_for_icon(icon.to_s.gsub('_', '-')),
          force_attributed: true,
          font: 'FontAwesome'.uifont(computed_options[:fa_size] || 14)
        }) if icon
        @computed_options
      end
    end
  end
end