Class: CanvasWebex::Meeting

Inherits:
WebexSession show all
Defined in:
lib/canvas_webex/meeting.rb

Constant Summary collapse

ATTRIBUTES =
[:meeting_key, :conf_name, :start_date, :host_joined, :status]

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from WebexSession

#host_url, #join_url, parse_time_stamp, recordings

Constructor Details

#initialize(meeting_xml) ⇒ Meeting

Public: Create a new Meeting

meeting_xml - The xml returned for a meeting (must already exist).



40
41
42
43
# File 'lib/canvas_webex/meeting.rb', line 40

def initialize(meeting_xml)
  @attr_cache = {}
  @xml = meeting_xml
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



49
50
51
52
53
54
55
# File 'lib/canvas_webex/meeting.rb', line 49

def method_missing(meth, *args, &block)
  if ATTRIBUTES.include?(meth)
    @attr_cache[meth] ||= @xml.at_xpath("//*[contains(translate(name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), '#{meth.to_s.camelcase(:lower).downcase}')]").try(:text)
  else
    super
  end
end

Class Method Details

.create(meeting_name, options = {}, client = CanvasWebex.client) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/canvas_webex/meeting.rb', line 29

def self.create(meeting_name, options = {}, client = CanvasWebex.client)
  if response = client.create_meeting(meeting_name, options)
    if meeting_key = response.at_xpath('//meetingkey').try(:text)
      retrieve(meeting_key, client)
    end
  end
end

.retrieve(meeting_key, client = CanvasWebex.client) ⇒ Object



23
24
25
26
27
# File 'lib/canvas_webex/meeting.rb', line 23

def self.retrieve(meeting_key, client = CanvasWebex.client)
  if response = client.get_meeting(meeting_key)
    Meeting.new(Nokogiri::XML(response.to_xml))
  end
end

Instance Method Details

#session_keyObject



45
46
47
# File 'lib/canvas_webex/meeting.rb', line 45

def session_key
  meeting_key
end