Class: Daxtra::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/daxtra/client.rb

Constant Summary collapse

PATH =
{
  http_prefix:         "http://",
  daxtra_server:       "cvxdemo.daxtra.com",
  api_version:         "/cvx/rest/api/v1",
  profile_full_path:   "/profile/full/json",
  convert_2_html_path: "/convert2html"
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(account:, **options) ⇒ Client

Returns a new instance of Client.



16
17
18
19
# File 'lib/daxtra/client.rb', line 16

def initialize(account:, **options)
  @account = 
  @server  = options.delete(:server)
end

Instance Method Details

#post_convert_2_html(file) ⇒ Object



28
29
30
31
32
33
# File 'lib/daxtra/client.rb', line 28

def post_convert_2_html(file)
  Faraday.post do |req|
    req.url(convert_2_html_url)
    req.body = body.merge(file: file)
  end
end

#post_profile_full(file) ⇒ Object



21
22
23
24
25
26
# File 'lib/daxtra/client.rb', line 21

def post_profile_full(file)
  Faraday.post do |req|
    req.url(profile_full_url)
    req.body = body.merge(file: file)
  end
end