Class: FontAwesome5Rails::Parsers::FaStackedIconParser

Inherits:
Object
  • Object
show all
Includes:
ParseMethods
Defined in:
lib/font_awesome5_rails/parsers/fa_stacked_icon_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ParseMethods

#arr_with_fa, #icon_type, #icon_type_path, #prepend_fa

Constructor Details

#initialize(icon, options) ⇒ FaStackedIconParser

Returns a new instance of FaStackedIconParser.



10
11
12
13
14
15
16
# File 'lib/font_awesome5_rails/parsers/fa_stacked_icon_parser.rb', line 10

def initialize(icon, options)
  @icon = icon
  @text = options[:text]
  @reverse = options[:reverse] == true
  @title = options[:title]
  @options = options
end

Instance Attribute Details

#options ⇒ Object (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/font_awesome5_rails/parsers/fa_stacked_icon_parser.rb', line 8

def options
  @options
end

#reverse ⇒ Object (readonly)

Returns the value of attribute reverse.



8
9
10
# File 'lib/font_awesome5_rails/parsers/fa_stacked_icon_parser.rb', line 8

def reverse
  @reverse
end

#text ⇒ Object (readonly)

Returns the value of attribute text.



8
9
10
# File 'lib/font_awesome5_rails/parsers/fa_stacked_icon_parser.rb', line 8

def text
  @text
end

#title ⇒ Object (readonly)

Returns the value of attribute title.



8
9
10
# File 'lib/font_awesome5_rails/parsers/fa_stacked_icon_parser.rb', line 8

def title
  @title
end

Instance Method Details

#first_icon_classes ⇒ Object



22
23
24
# File 'lib/font_awesome5_rails/parsers/fa_stacked_icon_parser.rb', line 22

def first_icon_classes
  @first_icon_classes ||= parse_icon_classes(@options[:base], true)
end

#more_options(key) ⇒ Object



30
31
32
# File 'lib/font_awesome5_rails/parsers/fa_stacked_icon_parser.rb', line 30

def more_options(key)
  options[key] ? options[key].except(:class, :text) : {}
end

#second_icon_classes ⇒ Object



26
27
28
# File 'lib/font_awesome5_rails/parsers/fa_stacked_icon_parser.rb', line 26

def second_icon_classes
  @second_icon_classes ||= parse_icon_classes(@icon, false)
end

#span_classes ⇒ Object



18
19
20
# File 'lib/font_awesome5_rails/parsers/fa_stacked_icon_parser.rb', line 18

def span_classes
  @span_classes ||= parse_span_classes
end