OMCMS

This gem is a ruby wrapper of OMCMS API's

Installation

Add this line to your application's Gemfile:

gem 'omcms-ruby-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omcms-ruby-client

Usage

Create a client using your OMCMS connector's public key and private key

# 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

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

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

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.