class Daxtra::Client

Constants

PATH

Attributes

account[R]
server[R]

Public Class Methods

new(account:, **options) click to toggle source
# File lib/daxtra/client.rb, line 16
def initialize(account:, **options)
  @account = account
  @server  = options.delete(:server)
end

Public Instance Methods

post_convert_2_html(file) click to toggle source
# 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) click to toggle source
# 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

Private Instance Methods

body() click to toggle source
# File lib/daxtra/client.rb, line 55
def body
  { account: account }
end
convert_2_html_url() click to toggle source
# File lib/daxtra/client.rb, line 49
def convert_2_html_url
  PATH.values_at(
    :http_prefix, :daxtra_server, :api_version, :convert_2_html_path
  ).join
end
path() click to toggle source
# File lib/daxtra/client.rb, line 39
def path
  @path ||= server ? PATH.merge(daxtra_server: server) : PATH
end
profile_full_url() click to toggle source
# File lib/daxtra/client.rb, line 43
def profile_full_url
  PATH.values_at(
    :http_prefix, :daxtra_server, :api_version, :profile_full_path
  ).join
end