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 +4 -4
- data/lib/braque/model.rb +2 -2
- data/lib/braque/version.rb +1 -1
- data/spec/braque/multiple_model_spec.rb +26 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8f32273525badac68fb7620a7d03a6071b3bd02
|
4
|
+
data.tar.gz: 61c45e0f60a64ce1dab46cdfe8551e320db78bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
50
|
-
|
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] }]
|
data/lib/braque/version.rb
CHANGED
@@ -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.
|
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-
|
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
|