Class: Stackoverflair::Flair
- Inherits:
-
Object
- Object
- Stackoverflair::Flair
- Defined in:
- lib/stackoverflair/flair.rb
Constant Summary collapse
- THEMES =
["default", "clean", "dark", "hotdog"]
Class Method Summary collapse
Class Method Details
.put ⇒ Object
6 7 8 9 10 |
# File 'lib/stackoverflair/flair.rb', line 6 def self.put return "You can use only these themes: #{themes}" unless THEMES.include? Stackoverflair::defaults[:theme] "<a href='http://stackoverflow.com/users/#{Stackoverflair::defaults[:id]}'> <img src='http://stackoverflow.com/users/flair/#{Stackoverflair::defaults[:id]}.png?theme=#{Stackoverflair::defaults[:theme]}' width='#{Stackoverflair::defaults[:width]}' height='#{Stackoverflair::defaults[:height]}' alt='#{set_default_alt}' title='#{set_default_title}'></a>" end |
.set_default_alt ⇒ Object
12 13 14 |
# File 'lib/stackoverflair/flair.rb', line 12 def self.set_default_alt Stackoverflair::defaults[:alt] ||= "profile for #{Stackoverflair::defaults[:name]} at Stack Overflow, Q&A for professional and enthusiast programmers " end |
.set_default_title ⇒ Object
16 17 18 |
# File 'lib/stackoverflair/flair.rb', line 16 def self.set_default_title Stackoverflair::defaults[:title] ||= "profile for #{Stackoverflair::defaults[:name]} at Stack Overflow, Q&A for professional and enthusiast programmers " end |
.themes ⇒ Object
20 21 22 |
# File 'lib/stackoverflair/flair.rb', line 20 def self.themes THEMES.join(', ') end |