Class: Gnucash::SecurityQuote
- Inherits:
-
Object
- Object
- Gnucash::SecurityQuote
- Includes:
- Gnucash::Support::LightInspect
- Defined in:
- lib/gnucash/security.rb
Overview
Price quote for a security (commodity) from the GnuCash price database: the value of one unit of the security expressed in currency as of date.
Instance Attribute Summary collapse
-
#currency_id ⇒ String
readonly
Commodity id of the quote currency (e.g. “USD”).
-
#currency_space ⇒ String
readonly
Commodity namespace (GnuCash “space”) of the quote currency.
-
#date ⇒ Date
readonly
Date of the price in the book (quote time, date-only).
-
#value ⇒ Value
readonly
Price of one unit of the security in the quote currency.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(value:, currency_space:, currency_id:, date:) ⇒ SecurityQuote
constructor
A new instance of SecurityQuote.
Methods included from Gnucash::Support::LightInspect
Constructor Details
#initialize(value:, currency_space:, currency_id:, date:) ⇒ SecurityQuote
Returns a new instance of SecurityQuote.
23 24 25 26 27 28 |
# File 'lib/gnucash/security.rb', line 23 def initialize(value:, currency_space:, currency_id:, date:) @value = value @currency_space = currency_space @currency_id = currency_id @date = date end |
Instance Attribute Details
#currency_id ⇒ String (readonly)
Returns Commodity id of the quote currency (e.g. “USD”).
18 19 20 |
# File 'lib/gnucash/security.rb', line 18 def currency_id @currency_id end |
#currency_space ⇒ String (readonly)
Returns Commodity namespace (GnuCash “space”) of the quote currency.
15 16 17 |
# File 'lib/gnucash/security.rb', line 15 def currency_space @currency_space end |
#date ⇒ Date (readonly)
Returns Date of the price in the book (quote time, date-only).
21 22 23 |
# File 'lib/gnucash/security.rb', line 21 def date @date end |
#value ⇒ Value (readonly)
Returns Price of one unit of the security in the quote currency.
12 13 14 |
# File 'lib/gnucash/security.rb', line 12 def value @value end |
Instance Method Details
#attributes ⇒ Object
30 31 32 |
# File 'lib/gnucash/security.rb', line 30 def attributes %i[value currency_space currency_id date] end |