Class: Finnhub::Merge_Country

Inherits:
Object
  • Object
show all
Defined in:
lib/Country.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:, country:) ⇒ Merge_Country

Returns a new instance of Merge_Country.



3
4
5
6
# File 'lib/Country.rb', line 3

def initialize(client:, country:)
  @client = client
  @country = country
end

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



8
9
10
# File 'lib/Country.rb', line 8

def country
  @country
end

Instance Method Details

#merger(from: nil, to: nil) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/Country.rb', line 10

def merger(from: nil, to: nil)
  url = "/merger?country=#{@country}"
  from = from.to_date.to_s if from.is_a?(Time)
  url += "&from=#{from}"
  to = to.to_date.to_s if to.is_a?(Time)
  url += "&to=#{to}"
  @client.request(url)
end