Class: Squall::Template

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

Overview

OnApp Template

Instance Attribute Summary

Attributes inherited from Base

#result, #success

Instance Method Summary (collapse)

Methods inherited from Base

#check_config, #default_params, #key_for_class, #request

Instance Method Details

- (Object) list

Lists available templates.

Returns:

  • an Array.



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

def list
  response = request(:get, '/templates.json')
  response.collect { |temp| temp['image_template'] }
end

- (Object) make_public(id)

Make a Template public so that it can be downloaded via a HTTP URL.

Parameters:

  • id

    ID of template

Returns:

  • a Hash.



18
19
20
21
# File 'lib/squall/template.rb', line 18

def make_public(id)
  response = request(:post, "/templates/#{id}/make_public.json")
  response.first[1]
end