public
Description: A gem for interacting with the Google Finance API
Homepage: http://www.fiascode.com
Clone URL: git://github.com/jspradlin/gmoney.git
jspradlin (author)
Wed Oct 14 17:15:10 -0700 2009
commit  688598fab1dc7d414dd9ec211070f536fb1466d3
tree    d4216f7b896193f0b1b24c9f415f32d6de3db12c
parent  e0d9acd96a498bcbeba336907a96f74f559ae97d
gmoney /
name age message
file .gitignore Tue Sep 15 19:59:06 -0700 2009 Added manifest file [jspradlin]
file Manifest Loading commit data...
file README.rdoc
file Rakefile Wed Sep 23 17:39:17 -0700 2009 Updated the description text for the gem creati... [jspradlin]
file gmoney.gemspec
directory lib/
directory spec/
README.rdoc

GMoney

A gem for interacting with the Google Finance API

Install

  gem install gmoney

Usage

Login


    > GMoney::GFSession.login('google username', 'password')

Portfolios


    > portfolios = GMoney::Portfolio.all #returns all of a users portfolios
    > portfolio = GMoney::Portfolio.find(9) #returns a specific portfolio

    > positions = portfolio.positions #returns an Array of the Positions held within a given portfolio

Positions


    > positions = GMoney::Position.find(9) #returns all of a users positions within a given portfolio, i.e. Portfolio "9"
    > position = GMoney::Position.find("9/NASDAQ:GOOG") #returns a specific position within a given portfolio

    > transactions = position.transactions #returns an Array of the Transactions within a given position

Transactions


    > transactions = GMoney::Transaction.find("9/NASDAQ:GOOG") #returns all of a users transactions within a given position
    > transaction = GMoney::Transaction.find("9/NASDAQ:GOOG/2") #returns a specific transaction within a given position

Options parameter

  The following methods:
    Portfolio.all
    Portfolio.find
    portfolio.positions #where portfolio is an instance of the Portfolio class

    Position.find
    position.transactions #where position is an instance of the Position class

    Transaction.find

  all take a hash as an optional last parameter.  Valid values for this hash are:

  * :returns - By default Google does not return a comprehensive list of returns data.  Set this parameter to true to access this information.
  * :refresh - GMoney caches the data returned from Google by default.  Set :refresh => true if you would like to get the latest data.
  * :eager - GMoney lazily loads children data (i.e. positions for a given Portfolio).  If you would like to load all of this data at once set :eager => true

License

(The MIT License)

Copyright © 2009 Justin Spradlin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.