Class: Pajamas::AvatarComponent
- Includes:
- Gitlab::Utils::StrongMemoize
- Defined in:
- app/components/pajamas/avatar_component.rb
Constant Summary collapse
- SIZE_OPTIONS =
[16, 24, 32, 48, 64, 96].freeze
Instance Method Summary collapse
-
#initialize(item, alt: nil, class: "", size: 64, avatar_options: {}) ⇒ AvatarComponent
constructor
A new instance of AvatarComponent.
Constructor Details
#initialize(item, alt: nil, class: "", size: 64, avatar_options: {}) ⇒ AvatarComponent
Returns a new instance of AvatarComponent.
19 20 21 22 23 24 25 |
# File 'app/components/pajamas/avatar_component.rb', line 19 def initialize(item, alt: nil, class: "", size: 64, avatar_options: {}) @item = item @alt = alt @class = binding.local_variable_get(:class) @size = filter_attribute(size.to_i, SIZE_OPTIONS, default: 64) @avatar_options = end |