Class: TableauServerClient::Resources::View
- Defined in:
- lib/tableau_server_client/resources/view.rb
Instance Attribute Summary collapse
-
#content_url ⇒ Object
readonly
Returns the value of attribute content_url.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owner ⇒ Object
writeonly
Sets the attribute owner.
-
#workbook_id ⇒ Object
readonly
Returns the value of attribute workbook_id.
Class Method Summary collapse
Instance Method Summary collapse
- #image(query_params: {}, file_path: nil) ⇒ Object
- #webpage_path ⇒ Object
- #webpage_url ⇒ Object
- #workbook ⇒ Object
Methods inherited from Resource
attr_reader, attributes, #attributes, #delete!, extract_attributes, extract_site_path, #initialize, location, #location, #path, plural_resource_name, resource_name, #server_url, #site_id, #site_path
Methods included from TableauServerClient::RequestBuilder
Constructor Details
This class inherits a constructor from TableauServerClient::Resources::Resource
Instance Attribute Details
#content_url ⇒ Object (readonly)
Returns the value of attribute content_url.
9 10 11 |
# File 'lib/tableau_server_client/resources/view.rb', line 9 def content_url @content_url end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/tableau_server_client/resources/view.rb', line 9 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/tableau_server_client/resources/view.rb', line 9 def name @name end |
#owner=(value) ⇒ Object (writeonly)
Sets the attribute owner
10 11 12 |
# File 'lib/tableau_server_client/resources/view.rb', line 10 def owner=(value) @owner = value end |
#workbook_id ⇒ Object (readonly)
Returns the value of attribute workbook_id.
9 10 11 |
# File 'lib/tableau_server_client/resources/view.rb', line 9 def workbook_id @workbook_id end |
Class Method Details
.from_collection_response(client, path, xml) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/tableau_server_client/resources/view.rb', line 18 def self.from_collection_response(client, path, xml) xml.xpath("//xmlns:views/xmlns:view").each do |s| id = s['id'] yield from_response(client, "#{path}/#{id}", s) end end |
.from_response(client, path, xml) ⇒ Object
12 13 14 15 16 |
# File 'lib/tableau_server_client/resources/view.rb', line 12 def self.from_response(client, path, xml) attrs = extract_attributes(xml) attrs['workbook_id'] = xml.xpath("xmlns:workbook")[0]['id'] new(client, path, attrs) end |
Instance Method Details
#image(query_params: {}, file_path: nil) ⇒ Object
37 38 39 40 41 |
# File 'lib/tableau_server_client/resources/view.rb', line 37 def image(query_params: {}, file_path: nil) return @image if @iamge @image = client.download_image(location(query_params: query_params), file_path: file_path) @image end |
#webpage_path ⇒ Object
33 34 35 |
# File 'lib/tableau_server_client/resources/view.rb', line 33 def webpage_path content_url.gsub('/sheets/', '/') end |
#webpage_url ⇒ Object
29 30 31 |
# File 'lib/tableau_server_client/resources/view.rb', line 29 def webpage_url "#{server_url}#{content}/#/views/#{webpage_path}" end |