Class: Maglev::Content::Icon
- Inherits:
-
Base
- Object
- Base
- Maglev::Content::Icon
show all
- Defined in:
- app/components/maglev/content/icon.rb
Instance Attribute Summary
Attributes inherited from Base
#content, #scope, #setting
Instance Method Summary
collapse
Methods inherited from Base
#asset_host, #dom_data, #initialize, #tag_data, #tag_id
Instance Method Details
#icon_class ⇒ Object
8
9
10
|
# File 'app/components/maglev/content/icon.rb', line 8
def icon_class
@content
end
|
#tag(view_context, options = {}) ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'app/components/maglev/content/icon.rb', line 16
def tag(view_context, options = {})
view_context.content_tag(:i, '',
{
class: [options.delete(:class), icon_class].compact.join(' '),
data: (options.delete(:data) || {}).merge(tag_data)
}.merge(options),
false)
end
|
#to_s ⇒ Object
12
13
14
|
# File 'app/components/maglev/content/icon.rb', line 12
def to_s
@content
end
|