class TableauServerClient::Resources::Subscription

Attributes

id[R]
subject[R]

Public Class Methods

from_collection_response(client, path, xml) { |from_response(client, "#{path}/#{id}", s)| ... } click to toggle source
# File lib/tableau_server_client/resources/subscription.rb, line 18
def self.from_collection_response(client, path, xml)
  xml.xpath("//xmlns:subscriptions/xmlns:subscription").each do |s|
    id = s['id']
    yield from_response(client, "#{path}/#{id}", s)
  end
end
from_response(client, path, xml) click to toggle source
# File lib/tableau_server_client/resources/subscription.rb, line 10
def self.from_response(client, path, xml)
  attrs = extract_attributes(xml)
  attrs['content_id'] = xml.xpath("xmlns:content")[0]['id']
  attrs['schedule_id'] = xml.xpath("xmlns:schedule")[0]['id']
  attrs['user_id']   = xml.xpath("xmlns:user")[0]['id']
  new(client, path, attrs)
end

Public Instance Methods

content() click to toggle source
# File lib/tableau_server_client/resources/subscription.rb, line 25
def content
  raise NotImplementedError
end
schedule() click to toggle source
# File lib/tableau_server_client/resources/subscription.rb, line 29
def schedule
  @schedule ||= @client.get_collection(Schedule.location(nil)).find {|s| s.id == @schedule_id }
end
user() click to toggle source
# File lib/tableau_server_client/resources/subscription.rb, line 33
def user
  @user ||= @client.get User.location(site_path, @user_id)
end