Class: BootstrapIcons::BootstrapIcon
- Inherits:
-
Object
- Object
- BootstrapIcons::BootstrapIcon
- Defined in:
- lib/bootstrap_icons/bootstrap_icon.rb
Instance Attribute Summary collapse
-
#fill ⇒ Object
readonly
Returns the value of attribute fill.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#viewBox ⇒ Object
readonly
Returns the value of attribute viewBox.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(symbol, options = {}) ⇒ BootstrapIcon
constructor
A new instance of BootstrapIcon.
-
#to_svg ⇒ Object
Returns an string representing a <svg> tag.
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, = {}) @symbol = symbol.to_s @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"] end |
Instance Attribute Details
#fill ⇒ Object (readonly)
Returns the value of attribute fill.
3 4 5 |
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3 def fill @fill end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
3 4 5 |
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3 def height @height end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3 def path @path end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
3 4 5 |
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3 def symbol @symbol end |
#viewBox ⇒ Object (readonly)
Returns the value of attribute viewBox.
3 4 5 |
# File 'lib/bootstrap_icons/bootstrap_icon.rb', line 3 def viewBox @viewBox end |
#width ⇒ Object (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_svg ⇒ Object
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 |