Class: AkamaiApi::ECCURequest
- Inherits:
-
Object
- Object
- AkamaiApi::ECCURequest
- Defined in:
- lib/akamai_api/eccu_request.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#email ⇒ Object
Returns the value of attribute email.
-
#file ⇒ Object
Returns the value of attribute file.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#property ⇒ Object
Returns the value of attribute property.
-
#status ⇒ Object
Returns the value of attribute status.
-
#upload_date ⇒ Object
Returns the value of attribute upload_date.
-
#uploaded_by ⇒ Object
Returns the value of attribute uploaded_by.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
- .all(args = {}) ⇒ Object
- .all_ids ⇒ Object
- .find(code, args = {}) ⇒ Object
- .first(args = {}) ⇒ Object
- .last(args = {}) ⇒ Object
- .publish(property, content, args = {}) ⇒ Object
- .publish_file(property, file_name, args = {}) ⇒ Object
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ ECCURequest
constructor
A new instance of ECCURequest.
Constructor Details
#initialize(attributes = {}) ⇒ ECCURequest
Returns a new instance of ECCURequest.
17 18 19 20 21 |
# File 'lib/akamai_api/eccu_request.rb', line 17 def initialize attributes = {} attributes.each do |key, value| send "#{key}=", value end end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
15 16 17 |
# File 'lib/akamai_api/eccu_request.rb', line 15 def code @code end |
#email ⇒ Object
Returns the value of attribute email.
15 16 17 |
# File 'lib/akamai_api/eccu_request.rb', line 15 def email @email end |
#file ⇒ Object
Returns the value of attribute file.
15 16 17 |
# File 'lib/akamai_api/eccu_request.rb', line 15 def file @file end |
#notes ⇒ Object
Returns the value of attribute notes.
15 16 17 |
# File 'lib/akamai_api/eccu_request.rb', line 15 def notes @notes end |
#property ⇒ Object
Returns the value of attribute property.
15 16 17 |
# File 'lib/akamai_api/eccu_request.rb', line 15 def property @property end |
#status ⇒ Object
Returns the value of attribute status.
15 16 17 |
# File 'lib/akamai_api/eccu_request.rb', line 15 def status @status end |
#upload_date ⇒ Object
Returns the value of attribute upload_date.
15 16 17 |
# File 'lib/akamai_api/eccu_request.rb', line 15 def upload_date @upload_date end |
#uploaded_by ⇒ Object
Returns the value of attribute uploaded_by.
15 16 17 |
# File 'lib/akamai_api/eccu_request.rb', line 15 def uploaded_by @uploaded_by end |
#version ⇒ Object
Returns the value of attribute version.
15 16 17 |
# File 'lib/akamai_api/eccu_request.rb', line 15 def version @version end |
Class Method Details
.all(args = {}) ⇒ Object
43 44 45 |
# File 'lib/akamai_api/eccu_request.rb', line 43 def all args = {} all_ids.map { |v| ECCURequest.find v, args } end |
.all_ids ⇒ Object
39 40 41 |
# File 'lib/akamai_api/eccu_request.rb', line 39 def all_ids AkamaiApi::ECCU::ListRequest.new.execute end |
.find(code, args = {}) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/akamai_api/eccu_request.rb', line 55 def find code, args = {} response = AkamaiApi::ECCU::FindRequest.new(code).execute args.fetch(:verbose, true) new :file => response.file, :status => response.status, :code => response.code, :notes => response.notes, :property => response.property, :email => response.email, :upload_date => response.uploaded_at, :uploaded_by => response.uploaded_by, :version => response.version end |
.first(args = {}) ⇒ Object
51 52 53 |
# File 'lib/akamai_api/eccu_request.rb', line 51 def first args = {} find all_ids.first, args end |
.last(args = {}) ⇒ Object
47 48 49 |
# File 'lib/akamai_api/eccu_request.rb', line 47 def last args = {} find all_ids.last, args end |
.publish(property, content, args = {}) ⇒ Object
73 74 75 76 |
# File 'lib/akamai_api/eccu_request.rb', line 73 def publish property, content, args = {} args = args.dup AkamaiApi::ECCU::PublishRequest.new(property, extract_property_arguments(args)).execute content, args end |
.publish_file(property, file_name, args = {}) ⇒ Object
68 69 70 71 |
# File 'lib/akamai_api/eccu_request.rb', line 68 def publish_file property, file_name, args = {} args[:file_name] = file_name publish property, File.read(file_name), args end |
Instance Method Details
#destroy ⇒ Object
34 35 36 |
# File 'lib/akamai_api/eccu_request.rb', line 34 def destroy AkamaiApi::ECCU::DestroyRequest.new(code).execute end |