Class: SQA::Portfolio::Trade
- Inherits:
-
Struct
- Object
- Struct
- SQA::Portfolio::Trade
- Defined in:
- lib/sqa/portfolio.rb
Overview
Represents a single trade
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#commission ⇒ Object
Returns the value of attribute commission.
-
#date ⇒ Object
Returns the value of attribute date.
-
#price ⇒ Object
Returns the value of attribute price.
-
#shares ⇒ Object
Returns the value of attribute shares.
-
#ticker ⇒ Object
Returns the value of attribute ticker.
-
#total ⇒ Object
Returns the value of attribute total.
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action
27 28 29 |
# File 'lib/sqa/portfolio.rb', line 27 def action @action end |
#commission ⇒ Object
Returns the value of attribute commission
27 28 29 |
# File 'lib/sqa/portfolio.rb', line 27 def commission @commission end |
#date ⇒ Object
Returns the value of attribute date
27 28 29 |
# File 'lib/sqa/portfolio.rb', line 27 def date @date end |
#price ⇒ Object
Returns the value of attribute price
27 28 29 |
# File 'lib/sqa/portfolio.rb', line 27 def price @price end |
#shares ⇒ Object
Returns the value of attribute shares
27 28 29 |
# File 'lib/sqa/portfolio.rb', line 27 def shares @shares end |
#ticker ⇒ Object
Returns the value of attribute ticker
27 28 29 |
# File 'lib/sqa/portfolio.rb', line 27 def ticker @ticker end |
#total ⇒ Object
Returns the value of attribute total
27 28 29 |
# File 'lib/sqa/portfolio.rb', line 27 def total @total end |
Instance Method Details
#to_h ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/sqa/portfolio.rb', line 28 def to_h { ticker: ticker, action: action, shares: shares, price: price, date: date, total: total, commission: commission } end |