Class: Maglev::Content::Icon

Inherits:
Base
  • Object
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

Constructor Details

This class inherits a constructor from Maglev::Content::Base

Instance Method Details

#icon_classObject



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.(:i, '',
                           {
                             class: [options.delete(:class), icon_class].compact.join(' '),
                             data: (options.delete(:data) || {}).merge(tag_data)
                           }.merge(options),
                           false)
end

#to_sObject



12
13
14
# File 'app/components/maglev/content/icon.rb', line 12

def to_s
  @content
end