Class: Fastly::Origin
- Inherits:
-
BelongsToServiceAndVersion
- Object
- Base
- BelongsToServiceAndVersion
- Fastly::Origin
- 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
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#name ⇒ Object
Returns the value of attribute name.
-
#service_id ⇒ Object
Returns the value of attribute service_id.
Attributes inherited from Base
Instance Method Summary collapse
-
#add_director(director) ⇒ Object
Add a Director object to an Origin.
-
#delete_director(director) ⇒ Object
Delete a Director object from an Origin.
Methods inherited from BelongsToServiceAndVersion
#as_hash, #service, #version, #version=, #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
#comment ⇒ Object
Returns the value of attribute comment.
4 5 6 |
# File 'lib/fastly/origin.rb', line 4 def comment @comment end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/fastly/origin.rb', line 4 def name @name end |
#service_id ⇒ Object
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 |