Class: Emarsys::Broadcast::HTTP

Inherits:
Object
  • Object
show all
Includes:
Validation
Defined in:
lib/emarsys/broadcast/http.rb

Instance Method Summary collapse

Methods included from Validation

#string_present?, #within_range?

Constructor Details

#initialize(config) ⇒ HTTP

Returns a new instance of HTTP.



7
8
9
10
# File 'lib/emarsys/broadcast/http.rb', line 7

def initialize(config)
  validate_config config
  @config = config
end

Instance Method Details

#get(path) ⇒ Object



20
21
22
# File 'lib/emarsys/broadcast/http.rb', line 20

def get(path)
  request(path, nil, :get)
end

#post(path, xml) ⇒ Object



12
13
14
# File 'lib/emarsys/broadcast/http.rb', line 12

def post(path, xml)
  request(path, xml, :post)
end

#put(path, xml) ⇒ Object



16
17
18
# File 'lib/emarsys/broadcast/http.rb', line 16

def put(path, xml)
  request(path, xml, :put)
end