Module: Abaddon
Defined Under Namespace
Classes: Runner
Instance Method Summary collapse
- #load(template) ⇒ Object
- #load_file(template) ⇒ Object
- #message(type) ⇒ Object
- #print_available_templates ⇒ Object
- #templates ⇒ Object
Instance Method Details
#load(template) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/abaddon.rb', line 13 def load(template) if templates.include? template load_file template else :not_found end end |
#load_file(template) ⇒ Object
9 10 11 |
# File 'lib/abaddon.rb', line 9 def load_file(template) require "#{File.dirname(__FILE__)}/templates/#{template}.rb" end |
#message(type) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/abaddon.rb', line 21 def (type) case type when :not_found puts "Oops! I can't do that (yet). Available templates are:" print_available_templates when :blank puts "Aviable templates are:" print_available_templates end end |
#print_available_templates ⇒ Object
32 33 34 35 |
# File 'lib/abaddon.rb', line 32 def print_available_templates templates.each { |s| print s } puts end |
#templates ⇒ Object
5 6 7 |
# File 'lib/abaddon.rb', line 5 def templates %w[mockup] end |