Class: Supertramp
- Inherits:
-
Object
- Object
- Supertramp
- Defined in:
- lib/supertramp.rb,
lib/supertramp/avatar.rb,
lib/supertramp/config.rb,
lib/supertramp/version.rb
Defined Under Namespace
Constant Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #data_url ⇒ Object
-
#initialize(initials: nil, name: nil, background: nil, shape: nil) ⇒ Supertramp
constructor
A new instance of Supertramp.
- #to_s ⇒ Object
Constructor Details
#initialize(initials: nil, name: nil, background: nil, shape: nil) ⇒ Supertramp
Returns a new instance of Supertramp.
12 13 14 15 16 17 18 19 |
# File 'lib/supertramp.rb', line 12 def initialize(initials: nil, name: nil, background: nil, shape: nil) @initials = initials @name = name @background = background @shape = shape validate_arguments end |
Class Method Details
.configure {|@@config| ... } ⇒ Object
37 38 39 |
# File 'lib/supertramp.rb', line 37 def self.configure yield @@config end |
.data_url(**options) ⇒ Object
33 34 35 |
# File 'lib/supertramp.rb', line 33 def self.data_url(**) new(**).data_url end |
.svg(**options) ⇒ Object
29 30 31 |
# File 'lib/supertramp.rb', line 29 def self.svg(**) new(**).to_s end |
Instance Method Details
#data_url ⇒ Object
25 26 27 |
# File 'lib/supertramp.rb', line 25 def data_url avatar.data_url end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/supertramp.rb', line 21 def to_s avatar.svg end |