Sha256: 5b5c5914a20e90b34e1eb47fe8b3cb8833d71c397c357ab1065294ed8f304834
Contents?: true
Size: 842 Bytes
Versions: 41
Compression:
Stored size: 842 Bytes
Contents
require "rubygems" require "bundler/setup" require "./examples/config" if File.exists?('examples/config.rb') require "api_client" require "multi_xml" module Highrise class Base < ApiClient::Resource::Base format :xml # In this hook we set the basic auth provided in the options connection do |connection| connection.handler.basic_auth connection.options[:user], connection.options[:pass] end always do endpoint HIGHRISE_URL options(:user => HIGHRISE_TOKEN, :pass => 'X') end end class Person < Base namespace false always do path "people" end def self.build_one(hash) hash.has_key?('people') ? build_many(hash['people']) : super(hash) end end end Highrise::Person.find_all.each do |person| puts "#{person.first_name} #{person.last_name}" end
Version data entries
41 entries across 41 versions & 1 rubygems
Version | Path |
---|---|
api_client-0.1.0 | examples/highrise.rb |