Class: Finnhub::Economic_Code
- Inherits:
-
Object
- Object
- Finnhub::Economic_Code
- Defined in:
- lib/Economic.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
- #data(plain: false) ⇒ Object
-
#initialize(client:, code:, hash:) ⇒ Economic_Code
constructor
A new instance of Economic_Code.
Constructor Details
#initialize(client:, code:, hash:) ⇒ Economic_Code
Returns a new instance of Economic_Code.
3 4 5 6 7 |
# File 'lib/Economic.rb', line 3 def initialize(client:, code:, hash:) @client = client @code = code @hash = hash end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
9 10 11 |
# File 'lib/Economic.rb', line 9 def code @code end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
9 10 11 |
# File 'lib/Economic.rb', line 9 def hash @hash end |
Instance Method Details
#data(plain: false) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/Economic.rb', line 11 def data(plain: false) output = @client.request("/economic?code=#{@code}") return output if plain output.map{|o| [Time.parse(o[0]), o[1]]} end |