Class: Catsay::Cat

Inherits:
Object
  • Object
show all
Defined in:
lib/cat.rb

Overview

Cat class does the meowing.

Instance Method Summary collapse

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(message)
  @message = message
  ERB.new(@template).result(binding)
end