Class: Mediaflux::NamespaceListRequest
- Defined in:
- app/models/mediaflux/namespace_list_request.rb
Overview
List all of the namespaces that are inside of a given namespace
Instance Attribute Summary collapse
-
#parent_namespace ⇒ Object
readonly
Returns the value of attribute parent_namespace.
Attributes inherited from Request
Class Method Summary collapse
-
.service ⇒ String
Specifies the Mediaflux service to use when creating assets.
Instance Method Summary collapse
-
#initialize(session_token:, parent_namespace:) ⇒ NamespaceListRequest
constructor
Constructor.
- #namespaces ⇒ Object
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:, parent_namespace:) ⇒ NamespaceListRequest
Constructor
13 14 15 16 |
# File 'app/models/mediaflux/namespace_list_request.rb', line 13 def initialize(session_token:, parent_namespace:) super(session_token: session_token) @parent_namespace = parent_namespace end |
Instance Attribute Details
#parent_namespace ⇒ Object (readonly)
Returns the value of attribute parent_namespace.
8 9 10 |
# File 'app/models/mediaflux/namespace_list_request.rb', line 8 def parent_namespace @parent_namespace end |
Class Method Details
.service ⇒ String
Specifies the Mediaflux service to use when creating assets
20 21 22 |
# File 'app/models/mediaflux/namespace_list_request.rb', line 20 def self.service "asset.namespace.list" end |
Instance Method Details
#namespaces ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/models/mediaflux/namespace_list_request.rb', line 24 def namespaces @namespaces ||= begin xml = response_xml namespaces = [] xml.xpath("/response/reply/result/namespace/namespace").each.each do |ns| id = ns.xpath("@id").text namespaces << { id: id, name: ns.text } end namespaces end end |