Class: BootstrapIcons::BootstrapIcon

Inherits:
Object
  • Object
show all
Defined in:
lib/bootstrap_icons/bootstrap_icon.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbol, options = {}) ⇒ BootstrapIcon

Returns a new instance of BootstrapIcon.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 5

def initialize(symbol, options = {})
  @symbol = symbol.to_s
  @options = options
  @bootstrap_icon = find_bootstrap_icon        
  @path = bootstrap_icon["path"]
  @width = bootstrap_icon["width"]
  @height = bootstrap_icon["height"]
  @fill = bootstrap_icon["fill"]
  @viewBox = bootstrap_icon["viewBox"]

  prepare_icon_options
end

Instance Attribute Details

#fillObject (readonly)

Returns the value of attribute fill.



3
4
5
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3

def fill
  @fill
end

#heightObject (readonly)

Returns the value of attribute height.



3
4
5
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3

def height
  @height
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3

def options
  @options
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3

def path
  @path
end

#symbolObject (readonly)

Returns the value of attribute symbol.



3
4
5
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3

def symbol
  @symbol
end

#viewBoxObject (readonly)

Returns the value of attribute viewBox.



3
4
5
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3

def viewBox
  @viewBox
end

#widthObject (readonly)

Returns the value of attribute width.



3
4
5
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3

def width
  @width
end

Instance Method Details

#to_svgObject

Returns an string representing a <svg> tag



19
20
21
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 19

def to_svg
  "<svg #{html_attributes}>#{path}</svg>"
end