Class: ApmexGoldQuoteOnly

Inherits:
QuoteOnly show all
Defined in:
lib/quote-only.rb

Instance Attribute Summary

Attributes inherited from QuoteOnly

#css, #friendly_name, #quote, #symbol, #url

Instance Method Summary collapse

Methods inherited from QuoteOnly

#to_s

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(options)
	super(options)
	@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

#matchObject



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