Class: AstroInsight::Services::Vedic::HoroscopeChartService

Inherits:
Object
  • Object
show all
Defined in:
lib/astroinsight/services/vedic/horoscope_chart.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ HoroscopeChartService

Returns a new instance of HoroscopeChartService.



9
10
11
# File 'lib/astroinsight/services/vedic/horoscope_chart.rb', line 9

def initialize(client)
  @client = client
end

Instance Method Details

#get_chart(chart_id, birth_details) ⇒ Object



13
14
15
16
# File 'lib/astroinsight/services/vedic/horoscope_chart.rb', line 13

def get_chart(chart_id, birth_details)
  payload = birth_details.respond_to?(:to_h) ? birth_details.to_h : birth_details
  @client.post("/horoscope/chart/#{CGI.escape(chart_id)}", payload)
end

#get_chart_image(chart_id, birth_details) ⇒ Object



18
19
20
21
# File 'lib/astroinsight/services/vedic/horoscope_chart.rb', line 18

def get_chart_image(chart_id, birth_details)
  payload = birth_details.respond_to?(:to_h) ? birth_details.to_h : birth_details
  @client.post("/horoscope/chart/image/#{CGI.escape(chart_id)}", payload)
end