Class: BAWSAQ::Stock
- Inherits:
-
Object
- Object
- BAWSAQ::Stock
- Defined in:
- lib/bawsaq/stock.rb
Constant Summary collapse
- ATTRIBUTES =
{ 'Id' => :id, 'Name' => :name, 'Summary' => :summary, 'CompanyCode' => :company_code, 'CompanyName' => :company_name, 'Index' => :index, 'CurrentPrice' => :current_price, 'HighPrice' => :high_price, 'LowPrice' => :low_price, 'PriceMovement' => :price_movement, 'PriceMovementPercent' => :price_movement_percent, 'PriceMovementDirection' => :price_movement_direction, 'TotalPrice' => :total_price, 'TotalPriceMovement' => :total_price_movement, 'TotalPriceMovementPercent' => :total_price_movement_percent, 'TotalPriceMovementDirection' => :total_price_movement_direction, 'Modifiers' => :modifiers, 'PriceHistory' => :price_history, 'IsLoggedIn' => :is_logged_in, }
Instance Method Summary collapse
-
#initialize(stock_hash) ⇒ Stock
constructor
A new instance of Stock.
Constructor Details
#initialize(stock_hash) ⇒ Stock
Returns a new instance of Stock.
28 29 30 31 32 |
# File 'lib/bawsaq/stock.rb', line 28 def initialize(stock_hash) ATTRIBUTES.each do |key, attr| send("#{attr}=", stock_hash[key]) end end |