Class: SoapyCake::Client
- Inherits:
-
Object
show all
- Defined in:
- lib/soapy_cake/client.rb
Constant Summary
collapse
{ 'Content-Type' => 'application/soap+xml;charset=UTF-8' }.freeze
Instance Method Summary
collapse
Constructor Details
#initialize(opts = {}) ⇒ Client
Returns a new instance of Client.
8
9
10
11
12
13
14
15
|
# File 'lib/soapy_cake/client.rb', line 8
def initialize(opts = {})
@opts = opts
@domain = fetch_opt(:domain) || raise(Error, 'Cake domain missing')
@api_key = fetch_opt(:api_key) || raise(Error, 'Cake API key missing')
@retry_count = fetch_opt(:retry_count, 4)
@write_enabled = ['yes', true].include?(fetch_opt(:write_enabled))
@time_converter = TimeConverter.new(fetch_opt(:time_zone), fetch_opt(:time_offset))
end
|
Instance Method Details
#read_only? ⇒ Boolean
21
22
23
|
# File 'lib/soapy_cake/client.rb', line 21
def read_only?
!write_enabled
end
|
#xml_response? ⇒ Boolean
17
18
19
|
# File 'lib/soapy_cake/client.rb', line 17
def xml_response?
opts[:xml_response] == true
end
|