Skip to content

Commit 454f4db

Browse files
committed
Merge pull request #2 from cb-talent-development/release/v0.3.0
v0.3.0 release
2 parents 27f5e59 + 60ef37d commit 454f4db

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
cortex-client (0.2.6)
4+
cortex-client (0.3.0)
55
faraday (~> 0.9)
66
faraday_middleware (~> 0.9.0)
77
oauth2 (~> 0.9)

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55

66
Ruby client library for [cortex](https://github.com/cb-talent-development/cortex)'s API.
77

8-
**0.1 Changes the constructor**
9-
10-
Please note that 0.1.0 and onward now require a hash be passed. You can access the previous functionality with the access_token key:
8+
## Constructor
119

1210
```ruby
1311
require 'cortex-client'
@@ -31,12 +29,26 @@ client = Cortex::Client.new(key: 'my-app-id', secret: 'secrey-key-ssh', base_url
3129
end
3230
```
3331

32+
## Result object
33+
34+
Cortex::Client will return a Cortex::Result object. The following methods are available:
35+
36+
- contents
37+
- is_error?
38+
- errors
39+
- page
40+
- per_page
41+
- total_items
42+
- range
43+
- range_start
44+
- range_end
45+
- raw_headers
46+
3447
### Supported Endpoints
3548

36-
- *Users* - me, get ,save
37-
- *Posts* - query, get, save, delete, feed
49+
- *Users* - me, get, save
50+
- *Posts* - query, get, save, delete, feed, feed/get, feed/get/released, feed/authors
3851

3952
### TODO
4053
- Handle pagination
41-
- Support for search queries
4254
- /media

lib/cortex/result.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Cortex
22
class Result
3-
attr_reader :raw_headers, :contents, :total_items, :page, :per_page, :errors, :range_start, :range_end, :range
3+
attr_reader :raw_headers, :contents, :total_items, :page, :per_page, :errors, :range_start, :range_end, :range, :status
44

55
def initialize(body, headers, status)
66
@contents = body

lib/cortex/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Cortex
2-
VERSION = '0.2.6'
2+
VERSION = '0.3.0'
33
end

spec/result_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@
3535
expect(failed.raw_headers).to eq({})
3636
end
3737

38+
it 'should expose the http status' do
39+
expect(result.status).to eq 200
40+
expect(failed.status).to eq 403
41+
end
42+
3843
end

0 commit comments

Comments
 (0)