Class: ApmexGoldQuoteOnly
Instance Attribute Summary
Attributes inherited from QuoteOnly
#css, #friendly_name, #quote, #symbol, #url
Instance Method Summary collapse
-
#initialize(options) ⇒ ApmexGoldQuoteOnly
constructor
A new instance of ApmexGoldQuoteOnly.
- #match ⇒ Object
Methods inherited from QuoteOnly
Constructor Details
#initialize(options) ⇒ ApmexGoldQuoteOnly
Returns a new instance of ApmexGoldQuoteOnly.
58 59 60 61 62 63 |
# File 'lib/quote-only.rb', line 58 def initialize() super() @css = 'table.table-spot-prices > tbody > tr:nth-child(1) > td:nth-child(2) > span' @url = 'http://www.apmex.com' match() end |
Instance Method Details
#match ⇒ Object
65 66 67 68 69 |
# File 'lib/quote-only.rb', line 65 def match super css_text_match = /(\d+\.\d+)/.match(@quote.to_s) @quote = css_text_match[1].to_f end |