braque 0.0.6 → 0.0.7

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: dab5d5d54312bfdbc5dd8893a06e73b82efced16
4
- data.tar.gz: e0ee2e72c8075d1c754fbe25492c439cc6aec1d5
3
+ metadata.gz: 17ebac669aabbc1f0001fa83b60e11d6e7071012
4
+ data.tar.gz: 58e44df33fae3b9f83dea7387b166cac0ca23391
5
5
  SHA512:
6
- metadata.gz: a48933aecf76a78a67bc9704ee3a5fe740be0507ec29d61f10ed6b643cb8a29d7afb8cbdc064c25b542b254a71521ac45c910bcddb053e9f5ece5abf885149c1
7
- data.tar.gz: 83f22620eb6fc152e500a9236f9605f0acab47310c27b94fd6947c9e924f3f94b5386b1ba88bd91dd06baf30553db36edaa5e9383955dee49a2f41c91b847a25
6
+ metadata.gz: dc9e535ae1f76e08dd8f94594489f5b1a74b2b0324ac0194db87ace0d6fd5f192a7765b635fd475f57f129446057c0114c1422162309016f22d5eb1acf90c110
7
+ data.tar.gz: e9f71ec7e1fe8f288905fae0ee136fb12f670e3680bee73c15bd7fe322a21025ef98557506216d975d2f2ec0957b0184f44566529cdcb7d0a89342bb155969fd
data/README.md CHANGED
@@ -4,7 +4,7 @@ Braque aims to provide a simple and familiar interface for setting up clients to
4
4
 
5
5
  Braque is an early-stage and exploratory project.
6
6
 
7
- [ ![Codeship Status for dylanfareed/braque](https://codeship.com/projects/c41fd480-9f37-0132-ec49-02db7f3f2d41/status?branch=master)](https://codeship.com/projects/65077)
7
+ [![Build Status](https://semaphoreci.com/api/v1/projects/c557a59e-1c1a-4719-a41a-6462a424ddfa/381676/badge.png)](https://semaphoreci.com/dylanfareed/braque)
8
8
 
9
9
  ### Model setup
10
10
 
@@ -3,15 +3,17 @@ module Braque
3
3
  class LinkedArray < Array
4
4
  attr_reader :next_link
5
5
  attr_reader :previous_link
6
+ attr_reader :total_count
6
7
 
7
8
  def initialize(response = [], klass)
8
9
  next_link = response._links.try(:next)
9
10
  previous_link = response._links.try(:prev)
11
+ total_count = response.try(:total_count)
10
12
  retrieved_items = []
11
13
  response.each do |item|
12
14
  retrieved_items << klass.new(item)
13
15
  end
14
- @retrieved_items, @next_link, @previous_link = retrieved_items, next_link, previous_link
16
+ @retrieved_items, @next_link, @previous_link, @total_count = retrieved_items, next_link, previous_link, total_count
15
17
  super retrieved_items
16
18
  end
17
19
  end
@@ -1,3 +1,3 @@
1
1
  module Braque
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -20,8 +20,10 @@ RSpec.describe Braque::Collection do
20
20
  end
21
21
 
22
22
  class ResponseCollection < Array
23
+ attr_reader :total_count
23
24
  attr_reader :_links
24
25
  def initialize(array = [], next_str, previous_str)
26
+ @total_count = 3
25
27
  @_links = ResponseLinks.new next_str, previous_str
26
28
  super array
27
29
  end
@@ -38,6 +40,9 @@ RSpec.describe Braque::Collection do
38
40
  it 'returns an array of the correct number of items' do
39
41
  expect(@linked_array.count).to eq 2
40
42
  end
43
+ it 'returns the correct total_count' do
44
+ expect(@linked_array.total_count).to eq 3
45
+ end
41
46
  it 'returns an array of new items based on the calling class' do
42
47
  expect(@linked_array.first.id).to eq 1
43
48
  expect(@linked_array.first.title).to eq @array.first[:title]
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.6
4
+ version: 0.0.7
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-03-06 00:00:00.000000000 Z
11
+ date: 2015-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hyperclient
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  requirements: []
98
98
  rubyforge_project:
99
- rubygems_version: 2.2.2
99
+ rubygems_version: 2.4.3
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: Braque provides a simple interface for interacting with Hypermedia API services