Class: Psei::Security
- Inherits:
-
Object
- Object
- Psei::Security
- Defined in:
- lib/psei/security.rb
Instance Method Summary collapse
- #date ⇒ Object
-
#initialize(headers = {}, parser = nil) ⇒ Security
constructor
A new instance of Security.
- #symbols ⇒ Object
-
#value(symbol) ⇒ Object
Returns the data of a specific security.
- #values ⇒ Object
Constructor Details
#initialize(headers = {}, parser = nil) ⇒ Security
Returns a new instance of Security.
3 4 5 6 7 |
# File 'lib/psei/security.rb', line 3 def initialize(headers={}, parser=nil) @parser = parser || Psei::Parser.new(Psei::SOURCE_URL, headers) @parsed = @parser.process @formatter = Psei::Formatter.new end |
Instance Method Details
#date ⇒ Object
22 23 24 |
# File 'lib/psei/security.rb', line 22 def date Psei::Date.new(@parsed).get end |
#symbols ⇒ Object
9 10 11 |
# File 'lib/psei/security.rb', line 9 def symbols securities_hash.keys end |
#value(symbol) ⇒ Object
Returns the data of a specific security
18 19 20 |
# File 'lib/psei/security.rb', line 18 def value symbol security symbol end |
#values ⇒ Object
13 14 15 |
# File 'lib/psei/security.rb', line 13 def values symbols.collect{ |x| value x } end |