diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-13 11:55:19 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-13 12:00:49 -0700 |
commit | 4f291fa528e5faad03def69ae7ac98224ab859db (patch) | |
tree | 3a9bc62fd9bfb6913b5899f6b86c953d4aa78c1d /activeresource/examples | |
parent | e8550ee0329586b32de425e905c7af7e65bc78a8 (diff) | |
download | rails-4f291fa528e5faad03def69ae7ac98224ab859db.tar.gz rails-4f291fa528e5faad03def69ae7ac98224ab859db.tar.bz2 rails-4f291fa528e5faad03def69ae7ac98224ab859db.zip |
Simple examples for require profiling
Diffstat (limited to 'activeresource/examples')
-rw-r--r-- | activeresource/examples/simple.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activeresource/examples/simple.rb b/activeresource/examples/simple.rb new file mode 100644 index 0000000000..b20ef61670 --- /dev/null +++ b/activeresource/examples/simple.rb @@ -0,0 +1,16 @@ +$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib" +require 'active_resource' +require 'active_resource/http_mock' +require 'active_support/core_ext/hash/conversions' + +ActiveSupport::XmlMini.backend = ENV['XMLMINI'] || 'REXML' +ActiveResource::HttpMock.respond_to do |mock| + mock.get '/people/1.xml', {}, { :id => 1, :name => 'bob' }.to_xml(:root => 'person') +end + +class Person < ActiveResource::Base + self.site = 'http://localhost/' +end + +bob = Person.find(1) +puts bob.inspect |