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



7
8
9
10
# File 'lib/cat.rb', line 7

def initialize(kwargs = {})
  @template = kwargs[:template]
  self
end

Instance Method Details

#meow(message) ⇒ Object

renders the message using an erb template returns the rendered template



14
15
16
17
# File 'lib/cat.rb', line 14

def meow(message)
  @message = message
  ERB.new(@template).result(binding)
end