Class: AdobeConnect::MeetingFolder

Inherits:
Object
  • Object
show all
Defined in:
lib/adobe_connect/meeting_folder.rb

Overview

Public: Represents a folder object inside of Connect.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, url, service = AdobeConnect::Service.new) ⇒ MeetingFolder

Public: Create a new AdobeConnect::MeetingFolder.

id - The SCO-ID of the folder object. name - The name of the folder object. url - The Connect URL of the object. service - An AdobeConnect::Service object (default: Service.new).



13
14
15
16
17
18
# File 'lib/adobe_connect/meeting_folder.rb', line 13

def initialize(id, name, url, service = AdobeConnect::Service.new)
  @name    = name
  @id      = id
  @service = service
  @url     = url
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/adobe_connect/meeting_folder.rb', line 5

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/adobe_connect/meeting_folder.rb', line 5

def name
  @name
end

#serviceObject (readonly)

Returns the value of attribute service.



5
6
7
# File 'lib/adobe_connect/meeting_folder.rb', line 5

def service
  @service
end

#urlObject (readonly)

Returns the value of attribute url.



5
6
7
# File 'lib/adobe_connect/meeting_folder.rb', line 5

def url
  @url
end

Class Method Details

.find(name, service = AdobeConnect::Service.new) ⇒ Object

Public: Find a folder on the current Connect instance.

name - The name of the folder to find. service - An AdobeConnect::Service object (default: Service.new).

Returns a new AdobeConnect::MeetingFolder object.



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/adobe_connect/meeting_folder.rb', line 33

def self.find(name, service = AdobeConnect::Service.new)
  response = service.sco_search_by_field(
    :query       => name,
    :filter_type => 'folder',
    :field       => 'name')

  MeetingFolder.new(response.at_xpath('//sco').attr('sco-id'),
    response.at_xpath('//name').text,
    response.at_xpath('//url-path').text,
    service)
end

.my_meetings_folder_id(service = AdobeConnect::Service.new) ⇒ Object

Public: Find the “My Meetings” folder ID of the currently logged in User

service - An AdobeConnect::Service object (default: Service.new).

Returns a string of the sco ID of the folder



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/adobe_connect/meeting_folder.rb', line 50

def self.my_meetings_folder_id(service = AdobeConnect::Service.new)
  response = service.sco_shortcuts({})
  folder = response.at_xpath('//shortcuts').children.select{|s|
    s.attr('type') == 'my-meetings'
  }[0]
  if folder.nil?
    nil
  else
    folder.attr('sco-id')
  end
end

Instance Method Details

#contentsObject

Public: Fetch the contents of this folder.

Returns a Nokogiri object.



23
24
25
# File 'lib/adobe_connect/meeting_folder.rb', line 23

def contents
  service.sco_contents(:sco_id => id)
end