Class: YahooStock::Result
- Inherits:
-
Object
- Object
- YahooStock::Result
- Defined in:
- lib/yahoo_stock/result.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ArrayFormat, HashFormat, XmlFormat
Instance Method Summary collapse
-
#initialize(context) ⇒ Result
constructor
A new instance of Result.
- #output ⇒ Object
- #store(filename) ⇒ Object
Constructor Details
#initialize(context) ⇒ Result
Returns a new instance of Result.
4 5 6 |
# File 'lib/yahoo_stock/result.rb', line 4 def initialize(context) @context = context end |
Instance Method Details
#output ⇒ Object
8 9 10 11 |
# File 'lib/yahoo_stock/result.rb', line 8 def output return @context if @context.is_a?(String) @context.output end |
#store(filename) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/yahoo_stock/result.rb', line 13 def store(filename) File.open(filename, 'a') do |f| f.write(output) f.write("\n") end end |