Class: Pdftable::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection = nil) ⇒ Client

Returns a new instance of Client.



6
7
8
# File 'lib/pdftable/client.rb', line 6

def initialize(connection = nil )
	@connection = connection || Pdftable::Connection.new
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



4
5
6
# File 'lib/pdftable/client.rb', line 4

def connection
  @connection
end

Instance Method Details

#convert(file_path, format: 'xml') ⇒ Object



10
11
12
13
# File 'lib/pdftable/client.rb', line 10

def convert(file_path, format: 'xml')
    path = "/api"
    connection.post(path, file: file_path, format: format)
end

#remaining_pagesObject



15
16
17
18
# File 'lib/pdftable/client.rb', line 15

def remaining_pages
	path = "/api/remaining"
    connection.get(path)
end