19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/cf/output_format.rb', line 19
def initialize(options={})
if !options.blank?
@settings = options
@line = options[:line] if options[:line].nil? ? nil : options[:line]
if !@line.nil?
options.delete(:line)
request =
{
:body =>
{
:api_key => CF.api_key,
:output_formats => options
}
}
resp = HTTParty.post("#{CF.api_url}#{CF.api_version}/lines/#{CF.account_name}/#{@line.title.downcase}/output_format.json",request)
self.errors = resp.parsed_response['error']['message'] if resp.code != 200
self.line.output_formats = self
end
end
end
|