full_circle 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +18 -0
  3. data/Gemfile +4 -0
  4. data/Guardfile +24 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +45 -0
  7. data/Rakefile +6 -0
  8. data/full_circle.gemspec +29 -0
  9. data/lib/full_circle/api.rb +34 -0
  10. data/lib/full_circle/connection.rb +18 -0
  11. data/lib/full_circle/object_builder.rb +31 -0
  12. data/lib/full_circle/response_parser.rb +44 -0
  13. data/lib/full_circle/version.rb +3 -0
  14. data/lib/full_circle.rb +12 -0
  15. data/spec/fixtures/vcr_cassettes/empty_event_area_response.yml +47 -0
  16. data/spec/fixtures/vcr_cassettes/empty_get_coupons_response.yml +47 -0
  17. data/spec/fixtures/vcr_cassettes/empty_get_events_response.yml +47 -0
  18. data/spec/fixtures/vcr_cassettes/empty_get_upcoming_events_response.yml +48 -0
  19. data/spec/fixtures/vcr_cassettes/multiple_event_areas_response.yml +51 -0
  20. data/spec/fixtures/vcr_cassettes/multiple_get_coupons_response.yml +60 -0
  21. data/spec/fixtures/vcr_cassettes/multiple_get_upcoming_events_response.yml +277 -0
  22. data/spec/fixtures/vcr_cassettes/multple_get_events_response.yml +96 -0
  23. data/spec/fixtures/vcr_cassettes/single_event_areas_response.yml +49 -0
  24. data/spec/fixtures/vcr_cassettes/single_get_coupons_response.yml +51 -0
  25. data/spec/fixtures/vcr_cassettes/single_get_events_response.yml +52 -0
  26. data/spec/fixtures/vcr_cassettes/single_get_upcoming_events_response.yml +61 -0
  27. data/spec/full_circle/api_spec.rb +170 -0
  28. data/spec/full_circle/connection_spec.rb +21 -0
  29. data/spec/full_circle/object_builder_spec.rb +21 -0
  30. data/spec/full_circle/response_parser_spec.rb +187 -0
  31. data/spec/spec_helper.rb +11 -0
  32. metadata +202 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZjJiNzU3NmY0NGNmMzJmZjgyNDUwYTAxNzFiNjQwOTFkYWFhZjJkNA==
5
+ data.tar.gz: !binary |-
6
+ NTA2NTgzNjljNTA1YjlmMDMzMjMxNmUyMzVjZTliZDdlZjQzYWNmMA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZWNjNjY0NTdiNWRjZWMyZTAzMWJhOTY0ZDFmYjQ5ZjBhNmJlYTIzOTVlNzI2
10
+ NzY3MGQ5MzM5NDEwODNmNDk3MmE0NDkxNWYyYzRiNTQ5NThkNmNlMzgxMDll
11
+ MjE0OTQ1MGIyYjg1OTM5ZTA4NGNjMTQyMGY0OGQ4MTQ3MTI0MGM=
12
+ data.tar.gz: !binary |-
13
+ ZjRhNGQ5NWM4ZTEzMmU3MmRiODM3NjNkZDk4NzA5YWYyZWU1MTBjMTY4NDdk
14
+ NGIzZTAxNzkyZjFhNTkzY2E0NmIyZTk3MzZjNzcyYmI5NjE2N2JkMzVjY2Mw
15
+ MzhjMTA3ZmU1Mzg0ZWRjNzU0YzJkNmFjMjE5NzBjNzhjZDQyZjk=
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ *.swp
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in full_circle.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,24 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'rspec', :cli => "--color" do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+
9
+ # Rails example
10
+ # watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
11
+ # watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
12
+ # watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
13
+ # watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
14
+ # watch('config/routes.rb') { "spec/routing" }
15
+ # watch('app/controllers/application_controller.rb') { "spec/controllers" }
16
+
17
+ # Capybara features specs
18
+ # watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
19
+
20
+ # Turnip features and steps
21
+ # watch(%r{^spec/acceptance/(.+)\.feature$})
22
+ # watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
23
+ end
24
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Aaron Renner
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # FullCircle
2
+
3
+ [![Code Climate](https://codeclimate.com/github/aaronrenner/full_circle.png)](https://codeclimate.com/github/aaronrenner/full_circle)
4
+ [![Dependency Status](https://gemnasium.com/aaronrenner/full_circle.png)](https://gemnasium.com/aaronrenner/full_circle)
5
+
6
+ FullCircle/ i library for interfacing with the 360Directories API.
7
+
8
+ ## Requirements
9
+
10
+ Ruby >= 1.9.2
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ gem 'full_circle'
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Or install it yourself as:
23
+
24
+ $ gem install full_circle
25
+
26
+ ## Usage
27
+
28
+ This library is VERY experimental, so it might be best to let it stablize before using.
29
+
30
+ ### Running from irb
31
+
32
+ You can load this library up in irb with the following commands
33
+
34
+ $ cd <gem dir>
35
+ $ irb
36
+ irb (main):001:0> require "./lib/full_circle"
37
+
38
+
39
+ ## Contributing
40
+
41
+ 1. Fork it
42
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
43
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
44
+ 4. Push to the branch (`git push origin my-new-feature`)
45
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'full_circle/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "full_circle"
8
+ gem.version = FullCircle::VERSION
9
+ gem.authors = ["Aaron Renner"]
10
+ gem.email = ["aaron@animascodelabs.com"]
11
+ gem.description = %q{Library for interfacing with the 360Directories API}
12
+ gem.summary = %q{Library for interfacing with the 360Directories API}
13
+ gem.homepage = "https://github.com/aaronrenner/full_circle"
14
+ gem.required_ruby_version = ">= 1.9.2"
15
+
16
+ gem.files = `git ls-files`.split($/)
17
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
+ gem.require_paths = ["lib"]
20
+
21
+ gem.add_dependency "httparty"
22
+ gem.add_dependency "activesupport", "~>3.2.12"
23
+ gem.add_development_dependency "rspec"
24
+ gem.add_development_dependency "vcr"
25
+ gem.add_development_dependency "webmock", "~> 1.8.0"
26
+ gem.add_development_dependency "rake"
27
+ gem.add_development_dependency "guard-rspec"
28
+ gem.add_development_dependency "rb-inotify", "~> 0.9"
29
+ end
@@ -0,0 +1,34 @@
1
+ module FullCircle
2
+ class API
3
+
4
+ attr_reader :connection
5
+
6
+ def initialize(connection)
7
+ @connection=connection
8
+ end
9
+
10
+ def fetch_events_for_ad(id)
11
+ parser = ResponseParser.new "ad.getEvents", "event"
12
+ response = connection.call_api_method("ad.getEvents", adId: id)
13
+ parser.parse response
14
+ end
15
+
16
+ def fetch_coupons_for_ad(id)
17
+ parser = ResponseParser.new "ad.getCoupons", "coupon"
18
+ response = connection.call_api_method("ad.getCoupons", adId: id)
19
+ parser.parse response
20
+ end
21
+
22
+ def fetch_event_areas()
23
+ parser = ResponseParser.new "city.getEventAreas", "eventArea"
24
+ response = connection.call_api_method("city.getEventAreas")
25
+ parser.parse response
26
+ end
27
+
28
+ def fetch_upcoming_events(params={})
29
+ parser = ResponseParser.new "city.getUpcomingEvents", "event"
30
+ response = connection.call_api_method("city.getUpcomingEvents", params)
31
+ parser.parse response
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,18 @@
1
+ module FullCircle
2
+ class Connection
3
+
4
+ attr_reader :domain
5
+
6
+ def initialize(domain)
7
+ @domain = domain
8
+ end
9
+
10
+ def base_uri
11
+ "http://api.#{domain}/1.0/"
12
+ end
13
+
14
+ def call_api_method(method_name, query_params={})
15
+ HTTParty.get(method_name,base_uri: base_uri, query: query_params)
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,31 @@
1
+ require 'ostruct'
2
+
3
+ module FullCircle
4
+ class ObjectBuilder
5
+
6
+ # This class takes a hash from the api response and builds the appropriate
7
+ # object.
8
+ #
9
+ # cls - Class responding to initialize(hash) that takes a hash and sets
10
+ # its instance variables
11
+ def initialize(cls=OpenStruct)
12
+ @cls = cls
13
+ end
14
+
15
+ def from_api_hash(hash)
16
+
17
+ @cls.new underscore_hash_keys(hash)
18
+ end
19
+
20
+
21
+ private
22
+ def underscore_hash_keys(hash)
23
+ result_hash ={}
24
+ hash.keys.each do |key|
25
+ result_hash[key.to_s.underscore] = hash[key]
26
+ end
27
+ result_hash
28
+ end
29
+
30
+ end
31
+ end
@@ -0,0 +1,44 @@
1
+ module FullCircle
2
+ class ResponseParser
3
+
4
+ attr_reader :api_method_name, :object_name
5
+
6
+ def initialize(api_method_name, object_name)
7
+ @api_method_name= api_method_name
8
+ @object_name = object_name
9
+ end
10
+
11
+ def parse(response)
12
+ if response
13
+ attrs = response.parsed_response
14
+
15
+ parse_response(attrs, response_name, object_name)
16
+ end
17
+ end
18
+
19
+
20
+
21
+
22
+ private
23
+
24
+ # example
25
+ # parseResponse(attrs, "city_getEventAreasResponse", "eventArea")
26
+ def parse_response(attrs, response_name, object_name)
27
+ if attrs[response_name][object_name.pluralize].nil?
28
+ []
29
+ else
30
+ response_attrs = Array.wrap(attrs[response_name][object_name.pluralize][object_name])
31
+
32
+ builder = ObjectBuilder.new
33
+ response_attrs.collect do |response_attr_set|
34
+ builder.from_api_hash(response_attr_set)
35
+ end
36
+ end
37
+ end
38
+
39
+ def response_name
40
+ @response_name ||= "#{api_method_name.gsub(/\./,'_')}Response"
41
+ end
42
+
43
+ end
44
+ end
@@ -0,0 +1,3 @@
1
+ module FullCircle
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,12 @@
1
+ require 'httparty'
2
+ require "active_support/core_ext"
3
+
4
+ require_relative 'full_circle/version'
5
+ require_relative 'full_circle/connection'
6
+ require_relative 'full_circle/object_builder'
7
+ require_relative 'full_circle/response_parser'
8
+ require_relative 'full_circle/api'
9
+
10
+ module FullCircle
11
+
12
+ end
@@ -0,0 +1,47 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.1019thewave.com/1.0/city.getEventAreas?
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Date:
16
+ - Tue, 26 Mar 2013 19:29:44 GMT
17
+ Server:
18
+ - Apache/2.2.3 (Red Hat)
19
+ X-Powered-By:
20
+ - PHP/5.3.15
21
+ Set-Cookie:
22
+ - PHPSESSID=agovqqkve5n9n88hbhr2c447m0; path=/
23
+ Expires:
24
+ - Mon, 26 Jul 1997 05:00:00 GMT
25
+ Cache-Control:
26
+ - no-store, no-cache, must-revalidate
27
+ - post-check=0, pre-check=0
28
+ Pragma:
29
+ - no-cache
30
+ Last-Modified:
31
+ - Tue, 26 Mar 2013 19:29:44 GMT
32
+ Content-Length:
33
+ - '166'
34
+ Connection:
35
+ - close
36
+ Content-Type:
37
+ - text/xml
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ! '<?xml version="1.0"?>
41
+
42
+ <city-getEventAreasResponse page="1" resultsPerPage="20" totalPages="0" totalResults="0"><eventAreas></eventAreas></city-getEventAreasResponse>
43
+
44
+ '
45
+ http_version:
46
+ recorded_at: Tue, 26 Mar 2013 19:29:44 GMT
47
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,47 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.360durango.com/1.0/ad.getCoupons?adId=1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Date:
16
+ - Mon, 18 Mar 2013 04:25:33 GMT
17
+ Server:
18
+ - Apache/2.2.3 (Red Hat)
19
+ X-Powered-By:
20
+ - PHP/5.3.15
21
+ Set-Cookie:
22
+ - PHPSESSID=3e8eu74q5oej89robir9vgbpl0; path=/
23
+ Expires:
24
+ - Mon, 26 Jul 1997 05:00:00 GMT
25
+ Cache-Control:
26
+ - no-store, no-cache, must-revalidate
27
+ - post-check=0, pre-check=0
28
+ Pragma:
29
+ - no-cache
30
+ Last-Modified:
31
+ - Mon, 18 Mar 2013 04:25:33 GMT
32
+ Content-Length:
33
+ - '89'
34
+ Connection:
35
+ - close
36
+ Content-Type:
37
+ - text/xml
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ! '<?xml version="1.0"?>
41
+
42
+ <ad-getCouponsResponse><coupons></coupons></ad-getCouponsResponse>
43
+
44
+ '
45
+ http_version:
46
+ recorded_at: Mon, 18 Mar 2013 04:25:35 GMT
47
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,47 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.360durango.com/1.0/ad.getEvents?adId=1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Date:
16
+ - Wed, 12 Dec 2012 17:31:39 GMT
17
+ Server:
18
+ - Apache/2.2.3 (Red Hat)
19
+ X-Powered-By:
20
+ - PHP/5.3.15
21
+ Set-Cookie:
22
+ - PHPSESSID=imqd2m14tlvukfbpcr1ejj9fd5; path=/
23
+ Expires:
24
+ - Mon, 26 Jul 1997 05:00:00 GMT
25
+ Cache-Control:
26
+ - no-store, no-cache, must-revalidate
27
+ - post-check=0, pre-check=0
28
+ Pragma:
29
+ - no-cache
30
+ Last-Modified:
31
+ - Wed, 12 Dec 2012 17:31:39 GMT
32
+ Content-Length:
33
+ - '85'
34
+ Connection:
35
+ - close
36
+ Content-Type:
37
+ - text/xml
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ! '<?xml version="1.0"?>
41
+
42
+ <ad-getEventsResponse><events></events></ad-getEventsResponse>
43
+
44
+ '
45
+ http_version:
46
+ recorded_at: Wed, 12 Dec 2012 17:31:42 GMT
47
+ recorded_with: VCR 2.3.0
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.boatersbluepages.com/1.0/city.getUpcomingEvents?
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Date:
16
+ - Tue, 26 Mar 2013 22:31:50 GMT
17
+ Server:
18
+ - Apache/2.2.3 (Red Hat)
19
+ X-Powered-By:
20
+ - PHP/5.3.15
21
+ Set-Cookie:
22
+ - PHPSESSID=a005ubf20h2t3qlpugnvujgp04; path=/
23
+ Expires:
24
+ - Mon, 26 Jul 1997 05:00:00 GMT
25
+ Cache-Control:
26
+ - no-store, no-cache, must-revalidate
27
+ - post-check=0, pre-check=0
28
+ Pragma:
29
+ - no-cache
30
+ Last-Modified:
31
+ - Tue, 26 Mar 2013 22:31:50 GMT
32
+ Content-Length:
33
+ - '166'
34
+ Connection:
35
+ - close
36
+ Content-Type:
37
+ - text/xml
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ! '<?xml version="1.0"?>
41
+
42
+ <city-getUpcomingEventsResponse page="1" resultsPerPage="20" totalPages="0"
43
+ totalResults="0"><events></events></city-getUpcomingEventsResponse>
44
+
45
+ '
46
+ http_version:
47
+ recorded_at: Tue, 26 Mar 2013 22:31:50 GMT
48
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.360durango.com/1.0/city.getEventAreas?
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Date:
16
+ - Tue, 26 Mar 2013 19:19:20 GMT
17
+ Server:
18
+ - Apache/2.2.3 (Red Hat)
19
+ X-Powered-By:
20
+ - PHP/5.3.15
21
+ Set-Cookie:
22
+ - PHPSESSID=8badiocd2443eskl6hvkcogse3; path=/
23
+ Expires:
24
+ - Mon, 26 Jul 1997 05:00:00 GMT
25
+ Cache-Control:
26
+ - no-store, no-cache, must-revalidate
27
+ - post-check=0, pre-check=0
28
+ Pragma:
29
+ - no-cache
30
+ Last-Modified:
31
+ - Tue, 26 Mar 2013 19:19:20 GMT
32
+ Content-Length:
33
+ - '537'
34
+ Connection:
35
+ - close
36
+ Content-Type:
37
+ - text/xml
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ! '<?xml version="1.0"?>
41
+
42
+ <city-getEventAreasResponse page="1" resultsPerPage="20" totalPages="1" totalResults="7"><eventAreas><eventArea
43
+ id="736" name="Bayfield"></eventArea><eventArea id="592" name="Durango Mountain
44
+ Resort"></eventArea><eventArea id="598" name="Durango North"></eventArea><eventArea
45
+ id="596" name="Durango South"></eventArea><eventArea id="737" name="Hesperus"></eventArea><eventArea
46
+ id="591" name="Historic Downtown"></eventArea><eventArea id="735" name="Vallecito"></eventArea></eventAreas></city-getEventAreasResponse>
47
+
48
+ '
49
+ http_version:
50
+ recorded_at: Tue, 26 Mar 2013 19:19:20 GMT
51
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,60 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.360durango.com/1.0/ad.getCoupons?adId=82196
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Date:
16
+ - Mon, 18 Mar 2013 04:30:33 GMT
17
+ Server:
18
+ - Apache/2.2.3 (Red Hat)
19
+ X-Powered-By:
20
+ - PHP/5.3.15
21
+ Set-Cookie:
22
+ - PHPSESSID=20196agcrfo3c8fdt4eahf2s43; path=/
23
+ Expires:
24
+ - Mon, 26 Jul 1997 05:00:00 GMT
25
+ Cache-Control:
26
+ - no-store, no-cache, must-revalidate
27
+ - post-check=0, pre-check=0
28
+ Pragma:
29
+ - no-cache
30
+ Last-Modified:
31
+ - Mon, 18 Mar 2013 04:30:33 GMT
32
+ Content-Length:
33
+ - '1127'
34
+ Connection:
35
+ - close
36
+ Content-Type:
37
+ - text/xml
38
+ body:
39
+ encoding: US-ASCII
40
+ string: ! '<?xml version="1.0"?>
41
+
42
+ <ad-getCouponsResponse><coupons><coupon id="31705" name="Free Hair Cut with
43
+ an Color Service" begin="2013-03-07" expire="2013-03-31" accept_offline="1"
44
+ accept_online="0" acceptMobile="1" acceptPrint="1"><offer>Available with Shannon,
45
+ Lizzie, Jamie, and Tegan only.</offer><restrictions>Valid any Monday, Tuesday,
46
+ or Wednesday in March. Sweet!</restrictions></coupon><coupon id="31706" name="Deep
47
+ Blue Muscle Rub Massage" begin="2013-03-07" expire="2013-03-31" accept_offline="1"
48
+ accept_online="0" acceptMobile="1" acceptPrint="1"><offer>Designed for athletes
49
+ but excellent for any overworked, tired, sore muscles. $70 for an hour and
50
+ $45 for high school students.</offer><restrictions>If child is under 18, we
51
+ require parental consent.</restrictions></coupon><coupon id="31707" name="15%
52
+ Off Skin Moisturizer" begin="2013-03-07" expire="2013-03-31" accept_offline="1"
53
+ accept_online="0" acceptMobile="1" acceptPrint="1"><offer>Save on product
54
+ when you receive any skin treatment.</offer><restrictions>Not valid with any
55
+ other coupons for products.</restrictions></coupon></coupons></ad-getCouponsResponse>
56
+
57
+ '
58
+ http_version:
59
+ recorded_at: Mon, 18 Mar 2013 04:30:36 GMT
60
+ recorded_with: VCR 2.4.0