Sha256: 8a388ba9b9ef43745ccc7faa42b6376b8faa210f9b99aee74663750f45f9a6b8
Contents?: true
Size: 1.45 KB
Versions: 2
Compression:
Stored size: 1.45 KB
Contents
# Journey A ruby wrapper for the Journey API. http://resources.journeyapps.com/api ## Installation Add this line to your application's Gemfile: gem 'embark-journey', require: 'journey' And then execute: $ bundle Or install it yourself as: $ gem install embark-journey ## Usage Configure Journey to use the relevant API credentials. For Rails, this would be placed in an initializer. Journey.configure do |c| c.api_site = ENV['JOURNEY_API_ENDPOINT'] c.api_user = ENV['JOURNEY_API_USERNAME'] c.api_password = ENV['JOURNEY_API_KEY'] end Create your resource models, inheriting from `Journey::Resource`. Under the hood, resources extend `ActiveResource::Base`. class User < Journey::Resource schema do string :name datetime :last_login string :state end enum :state, %w[Active Inactive] end ### Searching To perform a text search on a model's attributes: User.search('itni') ### Embedding associations Often you'll want to load associated resources without needing to make additional queries. This can be specified on the `belongs_to` declaration: class User < Journey::Resource belongs_to :account, embed: true end ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
embark-journey-0.0.9 | README.md |
embark-journey-0.0.8 | README.md |