braque 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44b724dc40bb1e18fa0eba1a82f5dfe1a807c2cf
4
- data.tar.gz: 9be6cb004854e702af66fe1d3ce51bfb68b1cbad
3
+ metadata.gz: a8f32273525badac68fb7620a7d03a6071b3bd02
4
+ data.tar.gz: 61c45e0f60a64ce1dab46cdfe8551e320db78bbb
5
5
  SHA512:
6
- metadata.gz: 5733dd191d4b2bb15bb340baa5f963221ce7b044ed8e411ab62a0e693bc61dee031bbeab70c74c23f22356285d7861d276e5d32a4d790dbe3470d7ca1e6f6e35
7
- data.tar.gz: bf5c45449c8dc3e6e13fe21568789a149e35ceb3735b1be3f91e21f73318f00b973161dbea082389121fa2ab479ed72eb551906fac3ec6fc472b457cd56043d7
6
+ metadata.gz: 08fa120fd5e8c39380d67e0c90e27622956c9a2a427513111483c561fae510fb734f2abe2ca8b4b9ee85b2ef2892a9ae593b61da6bf28ac01895a743e68a3d1b
7
+ data.tar.gz: cb610ebfec010ec2f90b30f6c59543fe2726623f4ce2b8cda97cb12646380109acfe4cf493b09dff9c07c4a348290e6d67b6f3acad1853580726bf90a2770c05
data/lib/braque/model.rb CHANGED
@@ -46,8 +46,8 @@ module Braque
46
46
 
47
47
  module ClassMethods
48
48
  include Braque::Collection
49
- cattr_accessor :api_root
50
- cattr_accessor :api_token
49
+ attr_accessor :api_root
50
+ attr_accessor :api_token
51
51
 
52
52
  def list(options = {})
53
53
  options = Hash[options.map { |k, v| [CGI.escape(k.to_s), v] }]
@@ -1,3 +1,3 @@
1
1
  module Braque
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Braque::Model, type: :model do
4
+ context 'with multiple defined Braque::Model classes' do
5
+ before do
6
+ class Breeze
7
+ include ::Braque::Model
8
+ self.api_root = 'http://localhost:9292'
9
+ self.api_token = 'replace-me'
10
+ end
11
+
12
+ class Tide
13
+ include ::Braque::Model
14
+ self.api_root = 'http://localhost:9393'
15
+ self.api_token = 'do-replace-me-as-well'
16
+ end
17
+ end
18
+
19
+ it 'sets the correct api_root and api_token for each class' do
20
+ expect(Tide.api_root).to eq 'http://localhost:9393'
21
+ expect(Tide.api_token).to eq 'do-replace-me-as-well'
22
+ expect(Breeze.api_root).to eq 'http://localhost:9292'
23
+ expect(Breeze.api_token).to eq 'replace-me'
24
+ end
25
+ end
26
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Fareed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-11 00:00:00.000000000 Z
11
+ date: 2015-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hyperclient
@@ -71,6 +71,7 @@ files:
71
71
  - spec/braque/collection_spec.rb
72
72
  - spec/braque/helpers/hypermedia_responses_helper_spec.rb
73
73
  - spec/braque/model_spec.rb
74
+ - spec/braque/multiple_model_spec.rb
74
75
  - spec/fixtures/collection.json
75
76
  - spec/fixtures/resource.json
76
77
  - spec/fixtures/root.json