Class: LesliView::Elements::Avatar
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- LesliView::Elements::Avatar
- Defined in:
- lib/lesli_view/elements/avatar.rb
Instance Attribute Summary collapse
-
#avatar_style ⇒ Object
readonly
Returns the value of attribute avatar_style.
-
#font_size ⇒ Object
readonly
Returns the value of attribute font_size.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#letter ⇒ Object
readonly
Returns the value of attribute letter.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(image: nil, name: "", size: "medium") ⇒ Avatar
constructor
A new instance of Avatar.
Constructor Details
#initialize(image: nil, name: "", size: "medium") ⇒ Avatar
Returns a new instance of Avatar.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/lesli_view/elements/avatar.rb', line 37 def initialize(image: nil, name: "", size: "medium") @image = image @name = name @size = size @letter = "" @font_size = "" @avatar_style = "" calculate_size get_letter unless @image end |
Instance Attribute Details
#avatar_style ⇒ Object (readonly)
Returns the value of attribute avatar_style.
35 36 37 |
# File 'lib/lesli_view/elements/avatar.rb', line 35 def avatar_style @avatar_style end |
#font_size ⇒ Object (readonly)
Returns the value of attribute font_size.
35 36 37 |
# File 'lib/lesli_view/elements/avatar.rb', line 35 def font_size @font_size end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
35 36 37 |
# File 'lib/lesli_view/elements/avatar.rb', line 35 def image @image end |
#letter ⇒ Object (readonly)
Returns the value of attribute letter.
35 36 37 |
# File 'lib/lesli_view/elements/avatar.rb', line 35 def letter @letter end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
35 36 37 |
# File 'lib/lesli_view/elements/avatar.rb', line 35 def name @name end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
35 36 37 |
# File 'lib/lesli_view/elements/avatar.rb', line 35 def size @size end |