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.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
Instance Method Summary collapse
- #data(plain: false) ⇒ Object
-
#initialize(client:, code:, description:) ⇒ Economic_Code
constructor
A new instance of Economic_Code.
Constructor Details
#initialize(client:, code:, description:) ⇒ Economic_Code
Returns a new instance of Economic_Code.
3 4 5 6 7 |
# File 'lib/Economic.rb', line 3 def initialize(client:, code:, description:) @client = client @code = code @description = description 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 |
#description ⇒ Object (readonly)
Returns the value of attribute description.
9 10 11 |
# File 'lib/Economic.rb', line 9 def description @description 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 |