Class: AstroInsight::Services::Vedic::CharDashaService

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CharDashaService

Returns a new instance of CharDashaService.



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

def initialize(client)
  @client = client
end

Instance Method Details

#get_antar_dasha(rashi_key, birth_details) ⇒ Object



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

def get_antar_dasha(rashi_key, birth_details)
  payload = birth_details.respond_to?(:to_h) ? birth_details.to_h : birth_details
  @client.post("/dasha/char/antar-dasha/#{CGI.escape(rashi_key)}", payload)
end

#get_current_dasha(birth_details) ⇒ Object



23
24
25
26
# File 'lib/astroinsight/services/vedic/char_dasha.rb', line 23

def get_current_dasha(birth_details)
  payload = birth_details.respond_to?(:to_h) ? birth_details.to_h : birth_details
  @client.post("/dasha/char/current-dasha", payload)
end

#get_major_dasha(birth_details) ⇒ Object



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

def get_major_dasha(birth_details)
  payload = birth_details.respond_to?(:to_h) ? birth_details.to_h : birth_details
  @client.post("/dasha/char/major-dasha", payload)
end