Class: LetterAvatar::Avatar::Identity
- Inherits:
-
Object
- Object
- LetterAvatar::Avatar::Identity
- Defined in:
- lib/letter_avatar/avatar.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#letter ⇒ Object
Returns the value of attribute letter.
Class Method Summary collapse
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
20 21 22 |
# File 'lib/letter_avatar/avatar.rb', line 20 def color @color end |
#letter ⇒ Object
Returns the value of attribute letter.
20 21 22 |
# File 'lib/letter_avatar/avatar.rb', line 20 def letter @letter end |
Class Method Details
.from_username(username) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/letter_avatar/avatar.rb', line 22 def self.from_username(username) identity = new identity.color = LetterAvatar::Colors.for(username) identity.letter = username[0].upcase identity end |