Class: Fastly::Origin

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

Overview

A logical group of directors - for example the asset server directors from all your DCNs

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, 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/origin.rb', line 4

def comment
  @comment
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#service_idObject

Returns the value of attribute service_id.



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

def service_id
  @service_id
end

Instance Method Details

#add_director(director) ⇒ Object

Add a Director object to an Origin

Return true on success and false on failure



26
27
28
29
# File 'lib/fastly/origin.rb', line 26

def add_director(director)
  hash = fetcher.client.post("#{Origin.put_path(self)}/director/#{director.name}")
  !hash.nil?
end

#delete_director(director) ⇒ Object

Delete a Director object from an Origin

Return true on success and false on failure



34
35
36
37
# File 'lib/fastly/origin.rb', line 34

def delete_director(director)
  hash = fetcher.client.delete("#{Origin.put_path(self)}/director/#{director.name}")
  !hash.nil?
end