Class: CurrencyQuote::Dolar
- Inherits:
-
Object
- Object
- CurrencyQuote::Dolar
- Defined in:
- lib/currency_quote/dolar.rb
Constant Summary collapse
- BASE_URL =
"https://www.bna.com.ar/Cotizador/HistoricoPrincipales"
Instance Attribute Summary collapse
-
#buy ⇒ Object
Returns the value of attribute buy.
-
#date ⇒ Object
Returns the value of attribute date.
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#sell ⇒ Object
Returns the value of attribute sell.
Instance Method Summary collapse
- #get_quotation ⇒ Object
-
#initialize(date:) ⇒ Dolar
constructor
A new instance of Dolar.
Constructor Details
#initialize(date:) ⇒ Dolar
Returns a new instance of Dolar.
11 12 13 |
# File 'lib/currency_quote/dolar.rb', line 11 def initialize(date:) @date = date end |
Instance Attribute Details
#buy ⇒ Object
Returns the value of attribute buy.
7 8 9 |
# File 'lib/currency_quote/dolar.rb', line 7 def buy @buy end |
#date ⇒ Object
Returns the value of attribute date.
7 8 9 |
# File 'lib/currency_quote/dolar.rb', line 7 def date @date end |
#doc ⇒ Object
Returns the value of attribute doc.
7 8 9 |
# File 'lib/currency_quote/dolar.rb', line 7 def doc @doc end |
#sell ⇒ Object
Returns the value of attribute sell.
7 8 9 |
# File 'lib/currency_quote/dolar.rb', line 7 def sell @sell end |
Instance Method Details
#get_quotation ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/currency_quote/dolar.rb', line 15 def get_quotation begin make_get_to_bna extract_data rescue Timeout::Error => e @data = @sell = @buy = 0 end return struct end |