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 Base

#fetcher

Instance Method Summary collapse

Methods inherited from BelongsToServiceAndVersion

#service, #version, #version=, #version_number

Methods inherited from Base

#as_hash, #delete!, delete_path, get_path, #initialize, list_path, path, post_path, put_path, #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



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

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

#delete_director(director) ⇒ Object

Delete a Director object from an Origin

Return true on success and false on failure



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

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