Class: YahooStock::Interface::ScripSymbol
- Inherits:
-
YahooStock::Interface
- Object
- YahooStock::Interface
- YahooStock::Interface::ScripSymbol
- Defined in:
- lib/yahoo_stock/interface/scrip_symbol.rb
Overview
DESCRIPTION:
Class to generate the right url and interface with yahoo to get Scrip / Stock Symbols
Defined Under Namespace
Classes: ScripSymbolError
Constant Summary
Constants inherited from YahooStock::Interface
Instance Attribute Summary collapse
-
#company ⇒ Object
Returns the value of attribute company.
Attributes inherited from YahooStock::Interface
Instance Method Summary collapse
-
#get ⇒ Object
Get uri content with the help of get method of the super class.
-
#initialize(company) ⇒ ScripSymbol
constructor
Scrapes the resulting page and gets data in between two points.
-
#uri ⇒ Object
Generate full uri with the help of uri method of the superclass.
- #values ⇒ Object
Methods inherited from YahooStock::Interface
Constructor Details
#initialize(company) ⇒ ScripSymbol
Scrapes the resulting page and gets data in between two points
12 13 14 15 16 17 18 |
# File 'lib/yahoo_stock/interface/scrip_symbol.rb', line 12 def initialize(company) @base_url = BASE_URLS[:scrip_symbol] @company = remove_any_space(company) @before_element = 'yfi_sym_results' @after_element = 'yfi_fp_left_bottom' add_observer(self) end |
Instance Attribute Details
#company ⇒ Object
Returns the value of attribute company.
10 11 12 |
# File 'lib/yahoo_stock/interface/scrip_symbol.rb', line 10 def company @company end |
Instance Method Details
#get ⇒ Object
Get uri content with the help of get method of the super class
27 28 29 30 |
# File 'lib/yahoo_stock/interface/scrip_symbol.rb', line 27 def get uri super() end |
#uri ⇒ Object
Generate full uri with the help of uri method of the superclass
21 22 23 24 |
# File 'lib/yahoo_stock/interface/scrip_symbol.rb', line 21 def uri @uri_parameters = {:s => @company} super() end |
#values ⇒ Object
32 33 34 |
# File 'lib/yahoo_stock/interface/scrip_symbol.rb', line 32 def values @values ||= get_values end |