README.md in tripletex_ruby_client-1.0.3 vs README.md in tripletex_ruby_client-1.0.4

- old
+ new

@@ -1,54 +1,21 @@ # Tripletex API Ruby Client TripletexRubyClient - the Ruby gem for the Tripletex API, at the courtesy of Rubynor AS. -This was built using swagger-codegen first, from [https://tripletex.no/v2-docs/](https://tripletex.no/v2-docs/) -and it needed change in config and auth to work for us. +Used in production. -We can't see how the other tripletex ruby client gems work, but this is working for us. +This was built using swagger-codegen first, from [https://tripletex.no/v2-docs/](https://tripletex.no/v2-docs/), but it didn't work out of the box. -## Installation +## Getting Started -### Build a gem +Gemfile -To build the Ruby code into a gem: + gem 'tripletex_ruby_client' -```shell -gem build tripletex_ruby_client.gemspec -``` +Usage -Then either install the gem locally: - -```shell -gem install ./tripletex_ruby_client-1.0.0.gem -``` -(for development, run `gem install --dev ./tripletex_ruby_client-1.0.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'tripletex_ruby_client', '~> 1.0.0' - -### Install from Git - -If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: - - gem 'tripletex_ruby_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' - -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb -``` - -## Getting Started - -Please follow the [installation](#installation) procedure and then run the following code: ```ruby # Load the gem require 'tripletex_ruby_client' # # Setup authorization - as autogenerated by swagger-codegen @@ -79,10 +46,13 @@ #Find activity by ID. result = api_instance.get(id, opts) p result rescue TripletexRubyClient::ApiError => e puts "Exception when calling ActivityApi->get: #{e}" + + validation_errors = JSON.parse(error.response_body)["validationMessages"] + # do your stuff end ``` ## Swagger Codegen @@ -91,9 +61,27 @@ - API version: 2.69.5 - Package version: 1.0.0 - Build package: io.swagger.codegen.languages.RubyClientCodegen For more information, please visit [https://github.com/Tripletex/tripletex-api2](https://github.com/Tripletex/tripletex-api2) + +## Build a gem + +To build the Ruby code into a gem: + +```shell +gem build tripletex_ruby_client.gemspec +``` + +Then either install the gem locally: + +```shell +gem install ./tripletex_ruby_client-1.0.0.gem +``` +(for development, run `gem install --dev ./tripletex_ruby_client-1.0.0.gem` to install the development dependencies) + +or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). + ## Documentation for API Endpoints All URIs are relative to *https://tripletex.no/v2*