Class: YFi::Quote
- Inherits:
-
Object
- Object
- YFi::Quote
- Defined in:
- lib/y_fi/quote.rb
Instance Attribute Summary collapse
-
#issuer_name ⇒ Object
Returns the value of attribute issuer_name.
-
#price ⇒ Object
Returns the value of attribute price.
-
#ticker ⇒ Object
Returns the value of attribute ticker.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ Quote
constructor
A new instance of Quote.
Constructor Details
#initialize(args) ⇒ Quote
Returns a new instance of Quote.
8 9 10 11 12 13 |
# File 'lib/y_fi/quote.rb', line 8 def initialize(args) args.each do |key, val| self.public_send("#{key}=", val) end self.ticker = self.ticker.to_s.upcase end |
Instance Attribute Details
#issuer_name ⇒ Object
Returns the value of attribute issuer_name.
3 4 5 |
# File 'lib/y_fi/quote.rb', line 3 def issuer_name @issuer_name end |
#price ⇒ Object
Returns the value of attribute price.
3 4 5 |
# File 'lib/y_fi/quote.rb', line 3 def price @price end |
#ticker ⇒ Object
Returns the value of attribute ticker.
3 4 5 |
# File 'lib/y_fi/quote.rb', line 3 def ticker @ticker end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/y_fi/quote.rb', line 3 def updated_at @updated_at end |
Class Method Details
.find_by_ticker(ticker) ⇒ Api::ExternalFund
18 19 20 |
# File 'lib/y_fi/quote.rb', line 18 def self.find_by_ticker(ticker) QuoteCollection.new([ticker]).first end |