Class: Oldskool::PuppetHandler
- Inherits:
-
Object
- Object
- Oldskool::PuppetHandler
- Defined in:
- lib/oldskool/puppet_handler.rb
Instance Method Summary collapse
- #handle_request(keyword, query) ⇒ Object
-
#initialize(params, keyword, config) ⇒ PuppetHandler
constructor
A new instance of PuppetHandler.
- #plugin_template(template) ⇒ Object
Constructor Details
#initialize(params, keyword, config) ⇒ PuppetHandler
Returns a new instance of PuppetHandler.
3 4 5 6 7 8 |
# File 'lib/oldskool/puppet_handler.rb', line 3 def initialize(params, keyword, config) @params = params @keyword = keyword @config = config self end |
Instance Method Details
#handle_request(keyword, query) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/oldskool/puppet_handler.rb', line 14 def handle_request(keyword, query) type = Puppetdoc.new(query) = [{:title => "Type Reference", :url => "http://docs.puppetlabs.com/references/stable/type.html"}, {:title => "Function Reference", :url => "http://docs.puppetlabs.com/references/stable/function.html"}, {:title => "Language Guide", :url => "http://docs.puppetlabs.com/guides/language_guide.html"}] {:template => plugin_template(:type), :type => type.doc, :topmenu => } end |
#plugin_template(template) ⇒ Object
10 11 12 |
# File 'lib/oldskool/puppet_handler.rb', line 10 def plugin_template(template) File.read(File.("../../../views/#{template}.erb", __FILE__)) end |