chameleon-ruby
A Ruby gem for simple interactions with the Chameleon APIs
Your API Secret is generated on the Integrations page. The Full API documentation can be found on our Developer hub!
Quick start
gem 'chameleon-ruby'
require 'chameleon'
Usage and Examples
Chameleon.configure do |config|
config.secret = ENV['CHAMELEON_SECRET']
end
Chameleon::SearchItem.index(uid, title: title, actions: actions)
uid = "documents:#{model.id}"
title = model.name
description = model.description
actions = [{ kind: 'navigate', url: "/documents/#{model.id}/edit" }]
actions = [{ kind: 'navigate', url: "/#{model.class.name.underscore}/#{model.id}/edit" }]
icon = { kind: 'uid', uid: 'cog' }
icon = { kind: 'image', image_url: 'https://cdn-icons-png.flaticon.com/512/9908/9908192.png' }
Chameleon::SearchItem.index(uid, title: title, actions: actions)
Chameleon::SearchItem.remove(uid)
Chameleon::SearchItem.index(uid, title: title, description: description, actions: actions)
icon = { kind: 'uid', uid: 'cog' }
Chameleon::SearchItem.index(uid, title: title, actions: actions, icon: icon)
Chameleon::SearchItem.index(uid, title: title, description: description, actions: actions, profile_uids: [user.id])
Chameleon::SearchItem.index(uid, title: title, actions: actions, profile_uids: [user.id, *document.shared_to_user_ids])
Chameleon::SearchItem.index(uid, title: title, actions: actions, company_uids: [company.id])
Chameleon::SearchItem.index(uid, title: title, actions: actions, segment_ids: [segment1_id, segment2_id])
Support
If you want to report a bug, or have ideas, feedback or questions about the gem itself, let us know via GitHub issues and the Chameleon team will do their best to provide a helpful answer.
Or another to reach us is to Contact us in your dashboard.
License
The gem is available as open source under the terms of the MIT License.
Code of conduct
Everyone interacting in this project’s codebases and issue trackers is expected to follow the code of conduct.
Contribution guide
Pull requests are welcome!