Programming, Functional Programming, Scala, Tutorial, Venkat Subramaniam.
s"http://download.finance.yahoo.com/d/quotes.csv?s=${ticker}&f=snbaopl1" ​ val data = io.Source.fromURL(url).mkString ​ val price = data.split(",")(4).toDouble ​ StockPrice(ticker, price) ​ } We fetch the latest stock price from the Yahoo URL, parse the result, and return an instance of StockPrice