Sha256: 4649c5484e3372d6dcd249ef180dbfba463db3a9dce9f5bfbf9aaa0bf484ab26
Contents?: true
Size: 1.63 KB
Versions: 3
Compression:
Stored size: 1.63 KB
Contents
# OMCMS This gem is a ruby wrapper of OMCMS API's ## Installation Add this line to your application's Gemfile: ```ruby gem 'omcms-ruby-client' ``` And then execute: ```shell $ bundle ``` Or install it yourself as: ```shell $ gem install omcms-ruby-client ``` ## Usage Create a client using your OMCMS connector's public key and private key ```ruby # config/initializers/omcms.rb $omcms = OMCMS::Client.new( host: ENV["OMCMS_API_HOST"], # https://www.example.com public_key: ENV["OMCMS_PUBLIC_KEY"], private_key: ENV["OMCMS_PRIVATE_KEY"], open_timeout: ENV["OMCMS_OPEN_TIMEOUT"], # optional default to 10 seconds timeout: ENV["OMCMS_TIMEOUT"] # optional default to 20 seconds ) ``` ### Offering You can fetch all or specific offering with `OMCMS::Client` ```ruby offerings = $omcms.offerings.all # => fetch all offerings available on OMCMS offering = $omcms.offerings.get(1) # => offering(id = 1) fetched from OMCMS ``` ### Component You can fetch all or specific component with specified `offering` ```ruby offering = $omcms.offerings.get(1) components = offering.components.all # => all components of offering(id = 1) component = offering.components.get(4) # => component(id = 4) of offering(id = 1) ``` ### Offering Data You can fetch all or specific offering_data with specified `offering` ```ruby offering = $omcms.offerings.get(1) offering_data = offering.data.all # => all offering_data of offering(id = 1) offering_data = offering.data.get(1) # => offering_data(id: 1) of offering(id = 1) ``` ## Contributing Bug reports and pull requests are welcome on GitHub at <https://github.com/equitymultiple/omcms-ruby-client.>
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
omcms-ruby-client-1.3.0 | README.md |
omcms-ruby-client-1.2.0 | README.md |
omcms-ruby-client-1.1.0 | README.md |