Class: Webecon::Icon
- Inherits:
-
Object
- Object
- Webecon::Icon
- Defined in:
- lib/webecon.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(name) ⇒ Icon
constructor
A new instance of Icon.
- #size(s) ⇒ Object
- #theme(t) ⇒ Object
- #trigger(t) ⇒ Object
Constructor Details
#initialize(name) ⇒ Icon
Returns a new instance of Icon.
10 11 12 |
# File 'lib/webecon.rb', line 10 def initialize(name) @name=name; @size=24; @stroke=2.0; @color="currentColor"; @secondary_color="none"; @secondary_opacity=0.35; @theme="line"; @animation="none"; @trigger="infinite" end |
Class Method Details
.icon(name) ⇒ Object
13 |
# File 'lib/webecon.rb', line 13 def self.icon(name); new(name); end |
Instance Method Details
#build ⇒ Object
17 |
# File 'lib/webecon.rb', line 17 def build; "<webecon-icon name='#{@name}' size='#{@size}' stroke='#{@stroke}' color='#{@color}' secondary-color='#{@secondary_color}' secondary-opacity='#{@secondary_opacity}' theme='#{@theme}' animation='#{@animation}' animation-mode='#{@trigger}'></webecon-icon>"; end |
#size(s) ⇒ Object
14 |
# File 'lib/webecon.rb', line 14 def size(s); @size=s; self; end |
#theme(t) ⇒ Object
15 |
# File 'lib/webecon.rb', line 15 def theme(t); @theme=t; self; end |
#trigger(t) ⇒ Object
16 |
# File 'lib/webecon.rb', line 16 def trigger(t); @trigger=t; self; end |