Class: Mediaflux::ProjectQuotaRequest
- Defined in:
- app/models/mediaflux/project_quota_request.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Attributes inherited from Request
Class Method Summary collapse
-
.service ⇒ String
Specifies the Mediaflux service to use.
Instance Method Summary collapse
-
#initialize(session_token:, asset_id:) ⇒ ProjectQuotaRequest
constructor
Constructor.
-
#quota ⇒ Object
Returns the quota information for collection in Mediaflux.
Methods inherited from Request
build_post_request, default_xml_namespace, default_xml_namespace_uri, #error?, find_or_create_http_client, format_date_for_mediaflux, request_path, #resolve, #resolved?, #response_body, #response_error, #response_xml, uri, #xml_payload, #xtoshell_xml
Constructor Details
#initialize(session_token:, asset_id:) ⇒ ProjectQuotaRequest
Constructor
9 10 11 12 |
# File 'app/models/mediaflux/project_quota_request.rb', line 9 def initialize(session_token:, asset_id:) super(session_token: session_token) @asset_id = asset_id end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
4 5 6 |
# File 'app/models/mediaflux/project_quota_request.rb', line 4 def document @document end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
4 5 6 |
# File 'app/models/mediaflux/project_quota_request.rb', line 4 def service_name @service_name end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'app/models/mediaflux/project_quota_request.rb', line 4 def token @token end |
Class Method Details
.service ⇒ String
Specifies the Mediaflux service to use
16 17 18 |
# File 'app/models/mediaflux/project_quota_request.rb', line 16 def self.service "tigerdata.project.quota.get" end |
Instance Method Details
#quota ⇒ Object
Returns the quota information for collection in Mediaflux
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/models/mediaflux/project_quota_request.rb', line 21 def quota result = response_xml.xpath("response/reply/result") { quota_allocation: result.xpath("quota-allocation").text.to_i, quota_allocation_human: result.xpath("quota-allocation/@h").text, quota_used: result.xpath("quota-used").text.to_i, quota_used_human: result.xpath("quota-used/@h").text, project_files: result.xpath("project-files").text.to_i, project_files_human: result.xpath("project-files/@h").text, recycle_bin: result.xpath("recycle-bin").text.to_i, recycle_bin_human: result.xpath("recycle-bin/@h").text, old_versions: result.xpath("old-versions").text.to_i, old_versions_human: result.xpath("old-versions/@h").text } end |