Class: Catsay::Cat
- Inherits:
-
Object
- Object
- Catsay::Cat
- Defined in:
- lib/cat.rb
Overview
Cat class does the meowing.
Instance Method Summary collapse
-
#initialize(kwargs = {}) ⇒ Cat
constructor
create a new instance of cat :template specifies which template to use the default template is :default.
-
#meow(message) ⇒ Object
renders the message using an erb template returns the rendered template.
Constructor Details
#initialize(kwargs = {}) ⇒ Cat
create a new instance of cat :template specifies which template to use the default template is :default
9 10 11 12 |
# File 'lib/cat.rb', line 9 def initialize(kwargs = {}) @template = kwargs[:template] return self end |
Instance Method Details
#meow(message) ⇒ Object
renders the message using an erb template returns the rendered template
16 17 18 19 |
# File 'lib/cat.rb', line 16 def meow() = ERB.new(@template).result(binding) end |