quovo 1.0.7 → 1.0.8

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: d1c43e1715da7a4a1e1c7c2daf375d66a8ae8534
4
- data.tar.gz: e44792819a5d09e9337be364d9dc2164ec943849
3
+ metadata.gz: 1d5dc88ba2b46017ab91e3df989dd7514dcd8428
4
+ data.tar.gz: de815ba227df562d12bafb7741e3133fe6c5a294
5
5
  SHA512:
6
- metadata.gz: f26586a0205b4550ad88b29e6172ca5a7b51ff29c160bc9f3a6f041fb1b7d423ba6f4e66456365d186d6a73a04706f494491f130271abf4bd5fb28f9182bb11a
7
- data.tar.gz: 7f511ffdda539258920b8dea196543dcba9bf3a11b048153a6a6aa62de3518b4a3719fd9dc1503159cff48fc34355a229926632265aa05d6775bc18896bcade2
6
+ metadata.gz: 6e917add2f8db567386671ddf68936df3cea763aa6e7e556aeb7348a08a9955db6b4a116f5302ff6582577c60c325b15ea739df6da33c864728b0e7f53c672a3
7
+ data.tar.gz: 8cc7a83e0ffa0cee92ace60a85a7432ab8257e182088091a12e4614b971f9197e2238434efc67f53fb9d74883bd32b38ed3767de4492e5f79f67c305e34952fe
data/README.md CHANGED
@@ -164,6 +164,11 @@ Hook is a registered callback that invokes when web request happens.
164
164
  client.positions.for_portfolio(portfolio_id)
165
165
  ```
166
166
 
167
+ ### Iframe_token
168
+ ```ruby
169
+ client.iframe_token.create(user_id)
170
+ ```
171
+
167
172
  ## Contributors
168
173
  * Canopy Financials [https://www.canopyfa.com](https://www.canopyfa.com)
169
174
  * Castle Digital Partners [https://castle.co](https://castle.co)
data/Rakefile CHANGED
@@ -9,4 +9,4 @@ end
9
9
 
10
10
  RuboCop::RakeTask.new
11
11
 
12
- task default: [:rubocop, :test]
12
+ task default: %i(rubocop test)
@@ -35,6 +35,7 @@ require 'quovo/models/portfolio'
35
35
  require 'quovo/models/user'
36
36
  require 'quovo/models/position'
37
37
  require 'quovo/models/transaction'
38
+ require 'quovo/models/iframe_token'
38
39
 
39
40
  require 'quovo/api/base'
40
41
  require 'quovo/api/brokerages'
@@ -44,6 +45,7 @@ require 'quovo/api/portfolios'
44
45
  require 'quovo/api/users'
45
46
  require 'quovo/api/positions'
46
47
  require 'quovo/api/history'
48
+ require 'quovo/api/iframe_token'
47
49
  require 'quovo/api'
48
50
 
49
51
  module Quovo
@@ -27,5 +27,9 @@ module Quovo
27
27
  def history
28
28
  @history ||= Quovo::Api::History.new
29
29
  end
30
+
31
+ def iframe_token
32
+ @iframe_token ||= Quovo::Api::IframeToken.new
33
+ end
30
34
  end
31
35
  end
@@ -0,0 +1,15 @@
1
+ module Quovo
2
+ module Api
3
+ class IframeToken < Base
4
+ using Quovo::Refinements::Cast
5
+ using Quovo::Refinements::Require
6
+
7
+ def create(user_id)
8
+ user_id.require!(as: :user_id)
9
+ api(:post, '/iframe_token', user: user_id)
10
+ .fetch('iframe_token')
11
+ .cast(Quovo::Models::IframeToken)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ module Quovo
2
+ module Models
3
+ class IframeToken < Base
4
+ fields %i(
5
+ user
6
+ token
7
+ )
8
+ def url
9
+ "https://embed.quovo.com/auth/#{token}"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -31,7 +31,7 @@ module Quovo
31
31
  end
32
32
 
33
33
  def build_http_request(uri, method, params)
34
- raise Quovo::HttpError, 'unsupported method' unless [:get, :post, :put, :delete].include?(method)
34
+ raise Quovo::HttpError, 'unsupported method' unless %i(get post put delete).include?(method)
35
35
  request = Kernel.const_get("Net::HTTP::#{method.to_s.capitalize}").new(uri)
36
36
  inject_http_params(request, params) if method != :get && params.any?
37
37
  request
@@ -1,3 +1,3 @@
1
1
  module Quovo
2
- VERSION = '1.0.7'.freeze
2
+ VERSION = '1.0.8'.freeze
3
3
  end
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'quovo/version'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quovo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Gorkunov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-11-07 00:00:00.000000000 Z
12
+ date: 2017-04-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Quovo RESTful API client, configurable, thread-safe and well-tested
15
15
  email:
@@ -31,6 +31,7 @@ files:
31
31
  - lib/quovo/api/brokerages.rb
32
32
  - lib/quovo/api/challenges.rb
33
33
  - lib/quovo/api/history.rb
34
+ - lib/quovo/api/iframe_token.rb
34
35
  - lib/quovo/api/portfolios.rb
35
36
  - lib/quovo/api/positions.rb
36
37
  - lib/quovo/api/users.rb
@@ -43,6 +44,7 @@ files:
43
44
  - lib/quovo/models/brokerage.rb
44
45
  - lib/quovo/models/challenge.rb
45
46
  - lib/quovo/models/choice.rb
47
+ - lib/quovo/models/iframe_token.rb
46
48
  - lib/quovo/models/image.rb
47
49
  - lib/quovo/models/portfolio.rb
48
50
  - lib/quovo/models/position.rb
@@ -81,9 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
83
  version: '0'
82
84
  requirements: []
83
85
  rubyforge_project:
84
- rubygems_version: 2.4.5
86
+ rubygems_version: 2.5.1
85
87
  signing_key:
86
88
  specification_version: 4
87
89
  summary: Quovo API client
88
90
  test_files: []
89
- has_rdoc: