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.
16 17 18 |
# File 'lib/letter_avatar/avatar.rb', line 16 def color @color end |
#letter ⇒ Object
Returns the value of attribute letter.
16 17 18 |
# File 'lib/letter_avatar/avatar.rb', line 16 def letter @letter end |
Class Method Details
.from_username(username) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/letter_avatar/avatar.rb', line 18 def self.from_username(username) identity = new identity.color = LetterAvatar::Colors.for(username) identity.letter = username[0].upcase identity end |