Class: Psei::Index
- Inherits:
-
Object
- Object
- Psei::Index
- Defined in:
- lib/psei/index.rb
Instance Method Summary collapse
- #date ⇒ Object
-
#initialize(parser = nil) ⇒ Index
constructor
A new instance of Index.
- #symbols ⇒ Object
-
#value(symbol) ⇒ Object
Returns the last value of an index.
-
#values ⇒ Object
Returns a Hash of last values of indices.
Constructor Details
#initialize(parser = nil) ⇒ Index
Returns a new instance of Index.
3 4 5 6 7 |
# File 'lib/psei/index.rb', line 3 def initialize(parser=nil) @parser = parser || Psei::Parser.new(Psei::SOURCE_URL) @parsed = @parser.process @formatter = Psei::Formatter.new end |
Instance Method Details
#date ⇒ Object
23 24 25 |
# File 'lib/psei/index.rb', line 23 def date Psei::Date.new(@parsed).get end |
#symbols ⇒ Object
9 10 11 |
# File 'lib/psei/index.rb', line 9 def symbols indices_hash.keys end |
#value(symbol) ⇒ Object
Returns the last value of an index
19 20 21 |
# File 'lib/psei/index.rb', line 19 def value symbol index symbol end |
#values ⇒ Object
Returns a Hash of last values of indices
14 15 16 |
# File 'lib/psei/index.rb', line 14 def values symbols.collect{ |x| value x } end |