Class: Exchanger::Operation::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/exchanger/operation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Request

Returns a new instance of Request.


32
33
34
35
36
37
# File 'lib/exchanger/operation.rb', line 32

def initialize(options = {})
  reset
  options.each do |name, value|
    send("#{name}=", value) if respond_to?("#{name}=")
  end
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body


30
31
32
# File 'lib/exchanger/operation.rb', line 30

def body
  @body
end

#responseObject

Returns the value of attribute response


30
31
32
# File 'lib/exchanger/operation.rb', line 30

def response
  @response
end

Instance Method Details

#actionObject

For a request with class Exchanger::FindItem::Request it will return “FindItem”.


43
44
45
# File 'lib/exchanger/operation.rb', line 43

def action
  self.class.name.split("::")[1]
end

#headersObject


47
48
49
50
# File 'lib/exchanger/operation.rb', line 47

def headers
  { "SOAPAction" => "http://schemas.microsoft.com/exchange/services/2006/messages/#{action}",
    "Content-Type" => "text/xml; charset=utf-8" }
end

#resetObject


39
40
# File 'lib/exchanger/operation.rb', line 39

def reset
end

#to_xmlObject


56
57
58
# File 'lib/exchanger/operation.rb', line 56

def to_xml
  raise "NotImplemented"
end