Class: Fastly::VCL

Inherits:
BelongsToServiceAndVersion show all
Defined in:
lib/fastly/vcl.rb

Overview

An internal representation of a Varnish Configuration Language file

Instance Attribute Summary collapse

Attributes inherited from BelongsToServiceAndVersion

#version

Attributes inherited from Base

#fetcher

Instance Method Summary collapse

Methods inherited from BelongsToServiceAndVersion

#as_hash, delete_path, get_path, path_escape, post_path, put_path, #service, #version_number

Methods inherited from Base

#as_hash, #delete!, delete_path, get_path, #initialize, list_path, path, post_path, put_path, #require_api_key!, #save!

Constructor Details

This class inherits a constructor from Fastly::Base

Instance Attribute Details

#commentObject

Returns the value of attribute comment.



4
5
6
# File 'lib/fastly/vcl.rb', line 4

def comment
  @comment
end

#contentObject

Returns the value of attribute content.



4
5
6
# File 'lib/fastly/vcl.rb', line 4

def content
  @content
end

#mainObject

Returns the value of attribute main.



4
5
6
# File 'lib/fastly/vcl.rb', line 4

def main
  @main
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/fastly/vcl.rb', line 4

def name
  @name
end

#service_idObject

Returns the value of attribute service_id.



4
5
6
# File 'lib/fastly/vcl.rb', line 4

def service_id
  @service_id
end

Instance Method Details

#set_main!Object

Set VCL as main VCL



45
46
47
48
# File 'lib/fastly/vcl.rb', line 45

def set_main!
  hash = fetcher.client.put("/service/#{service.id}/version/#{version_number}/vcl/#{name}/main")
  !hash.nil?
end