lib/render_cow.rb in render_cow-0.3.0 vs lib/render_cow.rb in render_cow-0.4.0
- old
+ new
@@ -1,8 +1,14 @@
require 'render_cow/version'
require 'render_cow/engine'
-
+require 'render_cow/spongebob'
module RenderCow
- def self.moo(mooo)
- Cowsay::Character::Cow.say(mooo)
+ class << self
+ def characters
+ @characters ||= Cowsay::Character.constants.map(&:downcase).map(&:to_sym).excluding(:base)
+ end
+
+ def moo(mooo, character = :cow)
+ Cowsay::Character.const_get(character.to_s.capitalize).say(mooo)
+ end
end
end