Project

wcc-arena

0.0
No commit activity in last 3 years
No release in over 3 years
Watermark's library for interfacing with Arena ChMS's web API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
~> 2.14

Runtime

~> 0.8.8
~> 1.6
 Project Readme

WCC::Arena

This gem provides wrappers to the Arena church management system's API. This is an early version of the library, and has had limited testing in real world environments. Use at your own risk!

There are also bound to be a few things that are specific to our configuration and version of Arena. This isn't intentional and we consider that a bug that we would like to fix. We would love for this to be a fully featured way to interact with Arena's API.

Installation

Add this line to your application's Gemfile:

gem 'wcc-arena'

And then execute:

$ bundle

Or install it yourself as:

$ gem install wcc-arena

Configuration

You can configure the wcc-arena gem using the WCC::Arena.configure method.

Here is an example configuration block:

WCC::Arena.configure do |arena|
  arena.username = 'username'
  arena.password = 'password'
  arena.api_key = 'api_key'
  arena.api_secret = 'api_secret'
  arena.api_url = 'https://arena-domain/api.svc/'
end

Usage

The library is currently a very thin layer over the Arena API. We plan to add a higher level interface layer that provides a better experience for the most common use cases.

The library consists of Query classes and Mapper classes. The Query classes handle calling the respective services and the Mapper classes handle binding the XML to Ruby objects. For full details on all available endpoints please see the code. Below are a few examples of some common queries.

person_query = WCC::Arena::PersonQuery.new.where(first_name: "Travis")
people = person_query.call
people.each do |person|
  puts person.full_name
end

This will print the full names of all person records with the first name "Travis". There are a ton of other attributes that are available on a Person record. Check them out on the Person model.

You can also query tags (or Profiles as they are called under the hood). To pull all top level Ministry tags run the following:

# This assumes that your ministry tags have a type ID of 1.
WCC::Arena::ProfileQuery.new(profile_type_id: 1).call.each do |tag|
  puts tag.name
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