Class: Finlight::Listing

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

Overview

A ticker listing on an exchange.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_codeObject (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_countryObject (readonly)

Returns the value of attribute exchange_country.



24
25
26
# File 'lib/finlight/models.rb', line 24

def exchange_country
  @exchange_country
end

#tickerObject (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