Class: FluentIcons::Fluent
- Inherits:
-
Object
- Object
- FluentIcons::Fluent
- Defined in:
- lib/fluent-icons/fluent.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#keywords ⇒ Object
readonly
Returns the value of attribute keywords.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(symbol, options = {}) ⇒ Fluent
constructor
A new instance of Fluent.
- #to_svg ⇒ Object
Constructor Details
#initialize(symbol, options = {}) ⇒ Fluent
Returns a new instance of Fluent.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fluent-icons/fluent.rb', line 5 def initialize(symbol, = {}) @symbol = symbol.to_s @style = ([:style] || 'regular').to_s @weight = ([:weight] || 20).to_s @prefix = ([:prefix] || 'fluent').to_s if (fluent = get_fluent_path(@symbol, style, weight, )) @path = fluent[:path] @width = fluent[:width] || 20 @height = fluent[:height] || 20 @keywords = fluent[:keywords] || [] @options = .dup @options.merge!({ class: classes, viewBox: viewbox, version: '1.1' }) @options.merge!(a11y) else raise "Couldn't find octicon symbol for #{ @symbol.inspect }" end end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
3 4 5 |
# File 'lib/fluent-icons/fluent.rb', line 3 def height @height end |
#keywords ⇒ Object (readonly)
Returns the value of attribute keywords.
3 4 5 |
# File 'lib/fluent-icons/fluent.rb', line 3 def keywords @keywords end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/fluent-icons/fluent.rb', line 3 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/fluent-icons/fluent.rb', line 3 def path @path end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
3 4 5 |
# File 'lib/fluent-icons/fluent.rb', line 3 def prefix @prefix end |
#style ⇒ Object (readonly)
Returns the value of attribute style.
3 4 5 |
# File 'lib/fluent-icons/fluent.rb', line 3 def style @style end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
3 4 5 |
# File 'lib/fluent-icons/fluent.rb', line 3 def symbol @symbol end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
3 4 5 |
# File 'lib/fluent-icons/fluent.rb', line 3 def weight @weight end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
3 4 5 |
# File 'lib/fluent-icons/fluent.rb', line 3 def width @width end |
Instance Method Details
#to_svg ⇒ Object
30 31 32 |
# File 'lib/fluent-icons/fluent.rb', line 30 def to_svg "<svg #{ html_attributes }>#{ @path }</svg>".strip end |