https://github.com/pietromoro/acube-rails
ACube API wrapper for ruby on rails framework
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.6%) to scientific vocabulary
Keywords
Repository
ACube API wrapper for ruby on rails framework
Basic Info
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
ACube API - Rails [WIP]
Wrapper library around the ACube API for ruby on rails. Quickly set up resources to manage invoices.
Usage
This will copy over the initializer file to your rails application and the necessary migrations:
$ bin/rails g a_cube:install
In the initializer file you have to set at the very least the following: ```ruby config.username = "your-login-email" config.password = "your-login-password"
config.invoiceendpoint = ENV.fetch('ACUBEINVOICEENDPOINT', "https://api-sandbox.acubeapi.com") config.commonendpoint = ENV.fetch('ACUBECOMMONENDPOINT', "https://common-sandbox.api.acubeapi.com") ```
For a complete list of configuration options, see the initializer file.
You have to designate two models to be used that will serve as the supplier/consumer contacts.
These will take care of the mapping between your application and the ACube API.
```ruby
include ACube::Support::Supplier
assupplier do |s| s.firstname = "..." s.lastname = :lastname end ``` String means constant value, symbol means method name on the model that will get called when the invoice is created.
```ruby include ACube::Support::Consumer
ascustoemr do |c| c.firstname = "..." c.lastname = :lastname end ``` For a full list of supported attributes, see the relevant file.
The last model is the one that will be associated with the invoices, so the payment model per say. ```ruby class Payment < ApplicationRecord hasoneinvoice :invoice
astransaction do |t|
t.amount = :amount
t.currency = "EUR"
t.paymentdate = :createdat
end
end
``
Thehasoneinvoicemethod will create the association between the payment and the invoice.
Theastransaction` method will create the mapping between the payment and the invoice.
The last step is to actually publish the invoice to the ACube API. ```ruby
In your controller somewhere
def create @payment = Payment.new(payment_params) supplier = Supplier.new(...) consumer = Consumer.new(...)
if @payment.save @payment.publish_invoice(supplier, consumer, :FPR12) # ... end end ```
Installation
Add this line to your application's Gemfile:
ruby
gem "acube-rails", require: "acube"
And then execute:
bash
$ bundle
Or install it yourself as:
bash
$ gem install acube-rails
Contributing
Contribution directions go here.
License
The gem is available as open source under the terms of the MIT License.
Owner
- Name: Pietro Moro
- Login: pietromoro
- Kind: user
- Website: https://pietromoro.dev
- Repositories: 2
- Profile: https://github.com/pietromoro
GitHub Events
Total
- Push event: 10
Last Year
- Push event: 10
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- sqlite3 >= 0
- actioncable 7.0.5.1
- actionmailbox 7.0.5.1
- actionmailer 7.0.5.1
- actionpack 7.0.5.1
- actiontext 7.0.5.1
- actionview 7.0.5.1
- activejob 7.0.5.1
- activemodel 7.0.5.1
- activerecord 7.0.5.1
- activestorage 7.0.5.1
- activesupport 7.0.5.1
- acube-rails 0.0.4
- builder 3.2.4
- bundler 2.3.18
- concurrent-ruby 1.2.2
- crass 1.0.6
- date 3.3.3
- erubi 1.12.0
- faraday 2.7.8
- faraday-net_http 3.0.2
- globalid 1.1.0
- i18n 1.14.1
- loofah 2.21.3
- mail 2.8.1
- marcel 1.0.2
- method_source 1.0.0
- mini_mime 1.1.2
- minitest 5.18.1
- net-imap 0.3.6
- net-pop 0.1.2
- net-protocol 0.2.1
- net-smtp 0.3.3
- nio4r 2.5.9
- nokogiri 1.15.2
- racc 1.7.1
- rack 2.2.7
- rack-test 2.1.0
- rails 7.0.5.1
- rails-dom-testing 2.0.3
- rails-html-sanitizer 1.6.0
- railties 7.0.5.1
- rake 13.0.6
- ruby2_keywords 0.0.5
- sqlite3 1.6.2
- thor 1.2.2
- timeout 0.4.0
- tzinfo 2.0.6
- websocket-driver 0.7.5
- websocket-extensions 0.1.5
- zeitwerk 2.6.8
- faraday ~> 2.7, >= 2.7.6
- rails >= 7.0.0