class Autodiscover::PoxResponse

Attributes

response[R]

Public Class Methods

new(response) click to toggle source
# File lib/autodiscover/pox_response.rb, line 6
def initialize(response)
  raise ArgumentError, "Response must be an XML string" if(response.nil? || response.empty?)
  @response = Nori.new(parser: :nokogiri).parse(response)["Autodiscover"]["Response"]
end

Public Instance Methods

ews_url() click to toggle source
# File lib/autodiscover/pox_response.rb, line 15
def ews_url
  expr_proto["EwsUrl"]
end
exch_proto() click to toggle source
# File lib/autodiscover/pox_response.rb, line 19
def exch_proto
  @exch_proto ||= (response["Account"]["Protocol"].select{|p| p["Type"] == "EXCH"}.first || {})
end
exchange_version() click to toggle source
# File lib/autodiscover/pox_response.rb, line 11
def exchange_version
  ServerVersionParser.new(exch_proto["ServerVersion"]).exchange_version
end
expr_proto() click to toggle source
# File lib/autodiscover/pox_response.rb, line 23
def expr_proto
  @expr_proto ||= (response["Account"]["Protocol"].select{|p| p["Type"] == "EXPR"}.first || {})
end
web_proto() click to toggle source
# File lib/autodiscover/pox_response.rb, line 27
def web_proto
  @web_proto ||= (response["Account"]["Protocol"].select{|p| p["Type"] == "WEB"}.first || {})
end