Class: Finlight::Listing
- Inherits:
-
Object
- Object
- Finlight::Listing
- Defined in:
- lib/finlight/models.rb
Overview
A ticker listing on an exchange.
Instance Attribute Summary collapse
-
#exchange_code ⇒ Object
readonly
Returns the value of attribute exchange_code.
-
#exchange_country ⇒ Object
readonly
Returns the value of attribute exchange_country.
-
#ticker ⇒ Object
readonly
Returns the value of attribute ticker.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ticker:, exchange_code:, exchange_country:) ⇒ Listing
constructor
A new instance of Listing.
Constructor Details
#initialize(ticker:, exchange_code:, exchange_country:) ⇒ Listing
Returns a new instance of Listing.
26 27 28 29 30 |
# File 'lib/finlight/models.rb', line 26 def initialize(ticker:, exchange_code:, exchange_country:) @ticker = ticker @exchange_code = exchange_code @exchange_country = exchange_country end |
Instance Attribute Details
#exchange_code ⇒ Object (readonly)
Returns the value of attribute exchange_code.
24 25 26 |
# File 'lib/finlight/models.rb', line 24 def exchange_code @exchange_code end |
#exchange_country ⇒ Object (readonly)
Returns the value of attribute exchange_country.
24 25 26 |
# File 'lib/finlight/models.rb', line 24 def exchange_country @exchange_country end |
#ticker ⇒ Object (readonly)
Returns the value of attribute ticker.
24 25 26 |
# File 'lib/finlight/models.rb', line 24 def ticker @ticker end |
Class Method Details
.from_h(hash) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/finlight/models.rb', line 32 def self.from_h(hash) new( ticker: hash["ticker"], exchange_code: hash["exchangeCode"], exchange_country: hash["exchangeCountry"] ) end |