Class: Badgify
- Inherits:
-
Object
- Object
- Badgify
- Defined in:
- lib/badgify.rb,
lib/badgify/version.rb
Constant Summary collapse
- CONFIG =
YAML.load_file('config/badgify_config.yml') rescue {}
- VERSION =
"0.0.4"
Instance Method Summary collapse
- #badge ⇒ Object
-
#initialize(key) ⇒ Badgify
constructor
A new instance of Badgify.
Constructor Details
#initialize(key) ⇒ Badgify
Returns a new instance of Badgify.
8 9 10 |
# File 'lib/badgify.rb', line 8 def initialize(key) @key = key end |
Instance Method Details
#badge ⇒ Object
12 13 14 15 |
# File 'lib/badgify.rb', line 12 def badge min_key = CONFIG.keys.detect {|x| x.include?(@key)} CONFIG[min_key].to_s end |