Class: Badgify

Inherits:
Object
  • Object
show all
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

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

#badgeObject



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