Class: SSC::Handler::Template

Inherits:
Base
  • Object
show all
Defined in:
lib/handlers/template.rb

Constant Summary

Constants inherited from Base

Base::API_URL

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Helper

included

Constructor Details

This class inherits a constructor from SSC::Handler::Base

Instance Method Details

#list(name) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/handlers/template.rb', line 14

def list(name)
  template_set= get_templates.select{|t| t.name == name}[0]

  if template_set.nil?
    say "Template set called '#{name}' was not found."
  else
    out = [template_set.name+' : '+template_set.description]
    out += template_set.template.collect do |appliance| 
      "#{appliance.appliance_id}: #{appliance.name}"
    end
    say_array out
  end
end

#list_setsObject



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

def list_sets
  templates= get_templates
  say_array templates.collect {|template| template.name}
end