Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Libraries

    Ruby/Finance 0.2.2

    Download button

    No screenshots available
    Downloads: 397  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Ian Macdonald | More programs
    GPL / FREE
    April 10th, 2006, 19:27 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Ruby/Finance description

    Ruby/Finance allows access to changing financial data, such as currency conversion rates and stock quotes.

    Ruby/Finance allows access to changing financial data, such as stock quotes and currency conversion rates.

    For the foreseeable future, it is intended to be a port of Perl's Finance::Quote module.

    Examples:

    Currency conversion

    require 'finance/currency'

    Display the US Dollar ($) to Euro () conversion rate.

    puts Finance::Currency::convert( 'EUR', 'USD' )

    Display the British Pounds Sterling () to Icelandic Kronur conversion
    rate for the amount of 32.50.

    puts Finance::Currency::convert( 'ISK', 'GBP', 32.50 )

    Stock quotes

    require 'finance/quote'

    q = Finance::Quote.new Answers will be given in the native
    currency of the exchange on which
    they are listed.

    q = Finance::Quote.new( 'EUR' ) Answers will be given in Euros.

    q.currency = 'VND' Switch to using Vietnamese Dong.

    info = q.fetch( 'usa', 'CRM' ) Fetch a single quote, namely CRM.

    info = q.fetch( :usa, 'EBAY', 'AMZN' ) Fetch EBAY and AMZN. Note that
    a Symbol can be used instead of a
    String for the exchange name.

    info = q.fetch( 'usa', %w[ EBAY AMZN ] ) An Array of ticker symbols is
    OK, too.
    puts info['EBAY'][:price]

    A block can be passed, too:

    q.fetch( :usa, 'RHAT' ) { |info| puts info['RHAT'][:high] }

    You can also bypass #fetch and call the exchange as a method:

    q.usa( 'RHAT' ) { |info| puts info['RHAT'][:high] }

    Installation:

    Minero Aoki's setup.rb script is included. Extensive documentation for this script can be found at the end of this document.

    Basically, however, the following should be enough to install the package:

    $ ruby setup.rb config
    $ ruby setup.rb setup
    # ruby setup.rb install

    ("#" line may require root privilege)

    Product's homepage

      


    TAGS:

    Ruby library | currency conversion | stock quotes | Ruby/Finance | Ruby | Finance



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM