Class: Comptaline::Client
- Inherits:
-
Object
- Object
- Comptaline::Client
- Defined in:
- lib/comptaline/client.rb
Instance Attribute Summary collapse
-
#host_url ⇒ Object
Returns the value of attribute host_url.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(configuration) ⇒ Client
constructor
A new instance of Client.
- #send(csv) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 |
# File 'lib/comptaline/client.rb', line 7 def initialize(configuration) @host_url = configuration.host_url @username = configuration.username @password = configuration.password end |
Instance Attribute Details
#host_url ⇒ Object
Returns the value of attribute host_url.
5 6 7 |
# File 'lib/comptaline/client.rb', line 5 def host_url @host_url end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/comptaline/client.rb', line 5 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/comptaline/client.rb', line 5 def username @username end |
Instance Method Details
#send(csv) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/comptaline/client.rb', line 13 def send(csv) file = make_file_for_multipart(csv) begin authenticated_request(:post, "OPERATIONS", { choice: "CSV" }, { fileName: file}) ensure File.unlink(file.path) end end |