Class: MoexIssClient::Security
- Inherits:
-
Object
- Object
- MoexIssClient::Security
- Defined in:
- lib/moex_iss_client/security.rb
Instance Attribute Summary collapse
-
#history ⇒ Object
readonly
Returns the value of attribute history.
Instance Method Summary collapse
- #attribute(attr) ⇒ Object
-
#initialize(history) ⇒ Security
constructor
A new instance of Security.
- #last_price ⇒ Object
- #sec_id ⇒ Object
- #shortname ⇒ Object
Constructor Details
#initialize(history) ⇒ Security
Returns a new instance of Security.
9 10 11 |
# File 'lib/moex_iss_client/security.rb', line 9 def initialize(history) @history = HistoryValidator.new.validate(history) end |
Instance Attribute Details
#history ⇒ Object (readonly)
Returns the value of attribute history.
7 8 9 |
# File 'lib/moex_iss_client/security.rb', line 7 def history @history end |
Instance Method Details
#attribute(attr) ⇒ Object
25 26 27 |
# File 'lib/moex_iss_client/security.rb', line 25 def attribute(attr) last_data_sample[attr.to_s.upcase] end |
#last_price ⇒ Object
13 14 15 |
# File 'lib/moex_iss_client/security.rb', line 13 def last_price last_data_sample['CLOSE'] end |
#sec_id ⇒ Object
21 22 23 |
# File 'lib/moex_iss_client/security.rb', line 21 def sec_id last_data_sample['SECID'] end |
#shortname ⇒ Object
17 18 19 |
# File 'lib/moex_iss_client/security.rb', line 17 def shortname last_data_sample['SHORTNAME'] end |