Class: FoxTail::AvatarComponent

Inherits:
BaseComponent show all
Defined in:
app/components/fox_tail/avatar_component.rb

Instance Attribute Summary

Attributes inherited from BaseComponent

#html_attributes

Instance Method Summary collapse

Methods inherited from BaseComponent

classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class

Methods inherited from Base

fox_tail_config

Constructor Details

This class inherits a constructor from FoxTail::BaseComponent

Instance Method Details

#borderObject



17
18
19
20
21
22
23
24
25
# File 'app/components/fox_tail/avatar_component.rb', line 17

def border
  if options[:border].is_a?(TrueClass)
    :default
  elsif !options[:border]
    :none
  else
    options[:border].to_sym
  end
end

#border?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'app/components/fox_tail/avatar_component.rb', line 27

def border?
  border != :none
end

#callObject



31
32
33
34
35
36
37
38
39
40
# File 'app/components/fox_tail/avatar_component.rb', line 31

def call
  if dot?
     :div, class: theme.apply("dot/container", self) do
      concat dot
      concat render_visual
    end
  else
    render_visual
  end
end