Class: Pdftable::Client
- Inherits:
-
Object
- Object
- Pdftable::Client
- Defined in:
- lib/pdftable/client.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #convert(file_path, format: 'xml') ⇒ Object
-
#initialize(connection = nil) ⇒ Client
constructor
A new instance of Client.
- #remaining_pages ⇒ Object
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
#connection ⇒ Object (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_pages ⇒ Object
15 16 17 18 |
# File 'lib/pdftable/client.rb', line 15 def remaining_pages path = "/api/remaining" connection.get(path) end |