Class: YahooStock::Result::ArrayFormat

Inherits:
YahooStock::Result show all
Defined in:
lib/yahoo_stock/result/array_format.rb

Overview

DESCRIPTION:

Parse results to show in an array form

USAGE

YahooStock::Result::ArrayFormat.new("data as commma separated values").output

Mostly will be used as a separate strategy for formatting results

Instance Method Summary collapse

Methods inherited from YahooStock::Result

#store

Constructor Details

#initialize(data) ⇒ ArrayFormat

Returns a new instance of ArrayFormat


12
13
14
15
# File 'lib/yahoo_stock/result/array_format.rb', line 12

def initialize(data)
  @data = data
  super(self)
end

Instance Method Details

#outputObject


17
18
19
# File 'lib/yahoo_stock/result/array_format.rb', line 17

def output
  CSV.parse @data
end