questrade_api 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.gitignore +4 -0
 - data/.rspec +2 -0
 - data/.travis.yml +3 -0
 - data/.yardopts +9 -0
 - data/Gemfile +15 -0
 - data/Guardfile +6 -0
 - data/{LICENSE.txt → LICENSE} +0 -0
 - data/README.md +31 -45
 - data/Rakefile +4 -0
 - data/lib/questrade_api/authorization.rb +94 -0
 - data/lib/questrade_api/client.rb +87 -0
 - data/lib/questrade_api/modules/util.rb +22 -0
 - data/lib/questrade_api/rest/account.rb +101 -0
 - data/lib/questrade_api/rest/activity.rb +58 -0
 - data/lib/questrade_api/rest/balance.rb +81 -0
 - data/lib/questrade_api/rest/base.rb +88 -0
 - data/lib/questrade_api/rest/execution.rb +59 -0
 - data/lib/questrade_api/rest/market.rb +42 -0
 - data/lib/questrade_api/rest/order.rb +58 -0
 - data/lib/questrade_api/rest/position.rb +48 -0
 - data/lib/questrade_api/rest/time.rb +26 -0
 - data/lib/questrade_api/version.rb +1 -1
 - data/questrade_api.gemspec +2 -3
 - data/spec/fixtures/json/accounts.json +21 -0
 - data/spec/fixtures/json/activities.json +36 -0
 - data/spec/fixtures/json/balances.json +55 -0
 - data/spec/fixtures/json/executions.json +46 -0
 - data/spec/fixtures/json/markets.json +34 -0
 - data/spec/fixtures/json/orders.json +49 -0
 - data/spec/fixtures/json/positions.json +17 -0
 - data/spec/fixtures/json/time.json +3 -0
 - data/spec/questrade_api/authorization_spec.rb +74 -0
 - data/spec/questrade_api/client_spec.rb +38 -0
 - data/spec/questrade_api/rest/account_spec.rb +88 -0
 - data/spec/questrade_api/rest/activity_spec.rb +70 -0
 - data/spec/questrade_api/rest/balance_spec.rb +34 -0
 - data/spec/questrade_api/rest/execution_spec.rb +80 -0
 - data/spec/questrade_api/rest/market_spec.rb +63 -0
 - data/spec/questrade_api/rest/order_spec.rb +95 -0
 - data/spec/questrade_api/rest/position_spec.rb +47 -0
 - data/spec/questrade_api/rest/time_spec.rb +34 -0
 - data/spec/spec_helper.rb +107 -0
 - data/spec/support/json_fixtures.rb +21 -0
 - metadata +61 -47
 
| 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module JSONFixtures
         
     | 
| 
      
 2 
     | 
    
         
            +
              # Return the path to the JSON fixtures directory
         
     | 
| 
      
 3 
     | 
    
         
            +
              def json_dir
         
     | 
| 
      
 4 
     | 
    
         
            +
                File.join File.dirname(__FILE__), "../fixtures/json"
         
     | 
| 
      
 5 
     | 
    
         
            +
              end
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
              # Return a filename for a JSON fixture
         
     | 
| 
      
 8 
     | 
    
         
            +
              def json_file(filename)
         
     | 
| 
      
 9 
     | 
    
         
            +
                File.join json_dir, filename
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              # Return the contents of a JSON fixture as a String
         
     | 
| 
      
 13 
     | 
    
         
            +
              def json_string(filename)
         
     | 
| 
      
 14 
     | 
    
         
            +
                File.read json_file(filename)
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              # Return the contents of a JSON fixture as a data structure
         
     | 
| 
      
 18 
     | 
    
         
            +
              def json_struct(filename)
         
     | 
| 
      
 19 
     | 
    
         
            +
                JSON.parse json_string(filename)
         
     | 
| 
      
 20 
     | 
    
         
            +
              end
         
     | 
| 
      
 21 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,57 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: questrade_api
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Bruno Meira
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2017-02- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2017-02-08 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
     | 
    
         
            -
              name: bundler
         
     | 
| 
       15 
     | 
    
         
            -
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       16 
     | 
    
         
            -
                requirements:
         
     | 
| 
       17 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       18 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       19 
     | 
    
         
            -
                    version: '1.14'
         
     | 
| 
       20 
     | 
    
         
            -
              type: :development
         
     | 
| 
       21 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       22 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       23 
     | 
    
         
            -
                requirements:
         
     | 
| 
       24 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       25 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
     | 
    
         
            -
                    version: '1.14'
         
     | 
| 
       27 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency
         
     | 
| 
       28 
     | 
    
         
            -
              name: guard
         
     | 
| 
       29 
     | 
    
         
            -
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       30 
     | 
    
         
            -
                requirements:
         
     | 
| 
       31 
     | 
    
         
            -
                - - ">="
         
     | 
| 
       32 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       33 
     | 
    
         
            -
                    version: '0'
         
     | 
| 
       34 
     | 
    
         
            -
              type: :development
         
     | 
| 
       35 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       36 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       37 
     | 
    
         
            -
                requirements:
         
     | 
| 
       38 
     | 
    
         
            -
                - - ">="
         
     | 
| 
       39 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       40 
     | 
    
         
            -
                    version: '0'
         
     | 
| 
       41 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency
         
     | 
| 
       42 
     | 
    
         
            -
              name: guard-rspec
         
     | 
| 
       43 
     | 
    
         
            -
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       44 
     | 
    
         
            -
                requirements:
         
     | 
| 
       45 
     | 
    
         
            -
                - - ">="
         
     | 
| 
       46 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       47 
     | 
    
         
            -
                    version: '0'
         
     | 
| 
       48 
     | 
    
         
            -
              type: :development
         
     | 
| 
       49 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       50 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       51 
     | 
    
         
            -
                requirements:
         
     | 
| 
       52 
     | 
    
         
            -
                - - ">="
         
     | 
| 
       53 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       54 
     | 
    
         
            -
                    version: '0'
         
     | 
| 
       55 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       56 
14 
     | 
    
         
             
              name: rspec
         
     | 
| 
       57 
15 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -116,13 +74,49 @@ extensions: [] 
     | 
|
| 
       116 
74 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       117 
75 
     | 
    
         
             
            files:
         
     | 
| 
       118 
76 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
      
 77 
     | 
    
         
            +
            - ".rspec"
         
     | 
| 
      
 78 
     | 
    
         
            +
            - ".travis.yml"
         
     | 
| 
      
 79 
     | 
    
         
            +
            - ".yardopts"
         
     | 
| 
       119 
80 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       120 
     | 
    
         
            -
            -  
     | 
| 
      
 81 
     | 
    
         
            +
            - Guardfile
         
     | 
| 
      
 82 
     | 
    
         
            +
            - LICENSE
         
     | 
| 
       121 
83 
     | 
    
         
             
            - README.md
         
     | 
| 
       122 
84 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       123 
85 
     | 
    
         
             
            - lib/questrade_api.rb
         
     | 
| 
      
 86 
     | 
    
         
            +
            - lib/questrade_api/authorization.rb
         
     | 
| 
      
 87 
     | 
    
         
            +
            - lib/questrade_api/client.rb
         
     | 
| 
      
 88 
     | 
    
         
            +
            - lib/questrade_api/modules/util.rb
         
     | 
| 
      
 89 
     | 
    
         
            +
            - lib/questrade_api/rest/account.rb
         
     | 
| 
      
 90 
     | 
    
         
            +
            - lib/questrade_api/rest/activity.rb
         
     | 
| 
      
 91 
     | 
    
         
            +
            - lib/questrade_api/rest/balance.rb
         
     | 
| 
      
 92 
     | 
    
         
            +
            - lib/questrade_api/rest/base.rb
         
     | 
| 
      
 93 
     | 
    
         
            +
            - lib/questrade_api/rest/execution.rb
         
     | 
| 
      
 94 
     | 
    
         
            +
            - lib/questrade_api/rest/market.rb
         
     | 
| 
      
 95 
     | 
    
         
            +
            - lib/questrade_api/rest/order.rb
         
     | 
| 
      
 96 
     | 
    
         
            +
            - lib/questrade_api/rest/position.rb
         
     | 
| 
      
 97 
     | 
    
         
            +
            - lib/questrade_api/rest/time.rb
         
     | 
| 
       124 
98 
     | 
    
         
             
            - lib/questrade_api/version.rb
         
     | 
| 
       125 
99 
     | 
    
         
             
            - questrade_api.gemspec
         
     | 
| 
      
 100 
     | 
    
         
            +
            - spec/fixtures/json/accounts.json
         
     | 
| 
      
 101 
     | 
    
         
            +
            - spec/fixtures/json/activities.json
         
     | 
| 
      
 102 
     | 
    
         
            +
            - spec/fixtures/json/balances.json
         
     | 
| 
      
 103 
     | 
    
         
            +
            - spec/fixtures/json/executions.json
         
     | 
| 
      
 104 
     | 
    
         
            +
            - spec/fixtures/json/markets.json
         
     | 
| 
      
 105 
     | 
    
         
            +
            - spec/fixtures/json/orders.json
         
     | 
| 
      
 106 
     | 
    
         
            +
            - spec/fixtures/json/positions.json
         
     | 
| 
      
 107 
     | 
    
         
            +
            - spec/fixtures/json/time.json
         
     | 
| 
      
 108 
     | 
    
         
            +
            - spec/questrade_api/authorization_spec.rb
         
     | 
| 
      
 109 
     | 
    
         
            +
            - spec/questrade_api/client_spec.rb
         
     | 
| 
      
 110 
     | 
    
         
            +
            - spec/questrade_api/rest/account_spec.rb
         
     | 
| 
      
 111 
     | 
    
         
            +
            - spec/questrade_api/rest/activity_spec.rb
         
     | 
| 
      
 112 
     | 
    
         
            +
            - spec/questrade_api/rest/balance_spec.rb
         
     | 
| 
      
 113 
     | 
    
         
            +
            - spec/questrade_api/rest/execution_spec.rb
         
     | 
| 
      
 114 
     | 
    
         
            +
            - spec/questrade_api/rest/market_spec.rb
         
     | 
| 
      
 115 
     | 
    
         
            +
            - spec/questrade_api/rest/order_spec.rb
         
     | 
| 
      
 116 
     | 
    
         
            +
            - spec/questrade_api/rest/position_spec.rb
         
     | 
| 
      
 117 
     | 
    
         
            +
            - spec/questrade_api/rest/time_spec.rb
         
     | 
| 
      
 118 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     | 
| 
      
 119 
     | 
    
         
            +
            - spec/support/json_fixtures.rb
         
     | 
| 
       126 
120 
     | 
    
         
             
            homepage: https://github.com/brunomeira/questrade_api
         
     | 
| 
       127 
121 
     | 
    
         
             
            licenses:
         
     | 
| 
       128 
122 
     | 
    
         
             
            - MIT
         
     | 
| 
         @@ -135,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       135 
129 
     | 
    
         
             
              requirements:
         
     | 
| 
       136 
130 
     | 
    
         
             
              - - ">="
         
     | 
| 
       137 
131 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       138 
     | 
    
         
            -
                  version:  
     | 
| 
      
 132 
     | 
    
         
            +
                  version: 2.0.0
         
     | 
| 
       139 
133 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       140 
134 
     | 
    
         
             
              requirements:
         
     | 
| 
       141 
135 
     | 
    
         
             
              - - ">="
         
     | 
| 
         @@ -147,4 +141,24 @@ rubygems_version: 2.5.1 
     | 
|
| 
       147 
141 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       148 
142 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       149 
143 
     | 
    
         
             
            summary: An elegant Ruby gem to interact with Questrade API
         
     | 
| 
       150 
     | 
    
         
            -
            test_files: 
     | 
| 
      
 144 
     | 
    
         
            +
            test_files:
         
     | 
| 
      
 145 
     | 
    
         
            +
            - spec/fixtures/json/accounts.json
         
     | 
| 
      
 146 
     | 
    
         
            +
            - spec/fixtures/json/activities.json
         
     | 
| 
      
 147 
     | 
    
         
            +
            - spec/fixtures/json/balances.json
         
     | 
| 
      
 148 
     | 
    
         
            +
            - spec/fixtures/json/executions.json
         
     | 
| 
      
 149 
     | 
    
         
            +
            - spec/fixtures/json/markets.json
         
     | 
| 
      
 150 
     | 
    
         
            +
            - spec/fixtures/json/orders.json
         
     | 
| 
      
 151 
     | 
    
         
            +
            - spec/fixtures/json/positions.json
         
     | 
| 
      
 152 
     | 
    
         
            +
            - spec/fixtures/json/time.json
         
     | 
| 
      
 153 
     | 
    
         
            +
            - spec/questrade_api/authorization_spec.rb
         
     | 
| 
      
 154 
     | 
    
         
            +
            - spec/questrade_api/client_spec.rb
         
     | 
| 
      
 155 
     | 
    
         
            +
            - spec/questrade_api/rest/account_spec.rb
         
     | 
| 
      
 156 
     | 
    
         
            +
            - spec/questrade_api/rest/activity_spec.rb
         
     | 
| 
      
 157 
     | 
    
         
            +
            - spec/questrade_api/rest/balance_spec.rb
         
     | 
| 
      
 158 
     | 
    
         
            +
            - spec/questrade_api/rest/execution_spec.rb
         
     | 
| 
      
 159 
     | 
    
         
            +
            - spec/questrade_api/rest/market_spec.rb
         
     | 
| 
      
 160 
     | 
    
         
            +
            - spec/questrade_api/rest/order_spec.rb
         
     | 
| 
      
 161 
     | 
    
         
            +
            - spec/questrade_api/rest/position_spec.rb
         
     | 
| 
      
 162 
     | 
    
         
            +
            - spec/questrade_api/rest/time_spec.rb
         
     | 
| 
      
 163 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     | 
| 
      
 164 
     | 
    
         
            +
            - spec/support/json_fixtures.rb
         
     |