Class: WebexXmlApi::Meeting::GetMeeting

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/webex_xml_api/meeting/get_meeting.rb

Constant Summary collapse

REQUEST_TYPE =
'java:com.webex.service.binding.meeting.GetMeeting'.freeze
PARAMETER_MAPPING =
{
  meeting_key: 'meetingKey'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Common

#check_response_and_return_data, #create_xml_request, #post_webex_request, #process_object

Constructor Details

#initialize(attributes = {}) ⇒ GetMeeting

Returns a new instance of GetMeeting.



14
15
16
17
18
19
# File 'lib/webex_xml_api/meeting/get_meeting.rb', line 14

def initialize(attributes = {})
  attributes.each_pair do |k, v|
    send("#{k}=", v) if PARAMETER_MAPPING.key?(k)
  end
  @security_context ||= WebexXmlApi::SecurityContext.new(attributes)
end

Instance Attribute Details

#meeting_keyObject

Returns the value of attribute meeting_key.



11
12
13
# File 'lib/webex_xml_api/meeting/get_meeting.rb', line 11

def meeting_key
  @meeting_key
end

#requestObject (readonly)

Returns the value of attribute request.



12
13
14
# File 'lib/webex_xml_api/meeting/get_meeting.rb', line 12

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



12
13
14
# File 'lib/webex_xml_api/meeting/get_meeting.rb', line 12

def response
  @response
end

#security_contextObject

Returns the value of attribute security_context.



11
12
13
# File 'lib/webex_xml_api/meeting/get_meeting.rb', line 11

def security_context
  @security_context
end

Instance Method Details

#send_requestObject



37
38
39
40
41
# File 'lib/webex_xml_api/meeting/get_meeting.rb', line 37

def send_request
  @request = to_xml
  @response = post_webex_request(security_context.site_name, @request)
  check_response_and_return_data(@response)
end

#to_xmlObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/webex_xml_api/meeting/get_meeting.rb', line 21

def to_xml
  raise WebexXmlApi::NotEnoughArguments,
        'Meeting::GetMeeting' unless valid?
  body_content = {}
  PARAMETER_MAPPING.each_pair do |k, v|
    body_content[v] = send(k) if send(k)
  end
  create_xml_request(@security_context.to_xml, REQUEST_TYPE,
                     body_content)
end

#valid?(context = self) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
35
# File 'lib/webex_xml_api/meeting/get_meeting.rb', line 32

def valid?(context = self)
  return false if context.meeting_key.nil?
  true
end