Class: WebServiceXStockQuote::Quote

Inherits:
Object
  • Object
show all
Defined in:
lib/webservicex_stock_quote.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.clientObject

Returns the value of attribute client.



10
11
12
# File 'lib/webservicex_stock_quote.rb', line 10

def client
  @client
end

.parserObject

Returns the value of attribute parser.



10
11
12
# File 'lib/webservicex_stock_quote.rb', line 10

def parser
  @parser
end

Class Method Details

.get(symbol) ⇒ Object



16
17
18
19
20
21
# File 'lib/webservicex_stock_quote.rb', line 16

def Quote.get(symbol)
  response = @client.call(:get_quote, :message => { :symbol => symbol })
  result = @parser.parse(response.body[:get_quote_response][:get_quote_result])

  return result[:stock_quotes][:stock]
end