module PrimeAwesome::LabelDrawElement

Public Class Methods

included(base) click to toggle source
# 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

Public Instance Methods

computed_options() click to toggle source
Calls superclass method
# File lib/prime_awesome/draw_label.rb, line 6
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