Class: Astroapi::Categories::Horoscope

Inherits:
BaseCategory show all
Defined in:
lib/astroapi/categories/horoscope.rb

Overview

Horoscope category client for daily/weekly/monthly horoscopes

Instance Attribute Summary

Attributes inherited from BaseCategory

#http

Instance Method Summary collapse

Methods inherited from BaseCategory

#initialize

Constructor Details

This class inherits a constructor from Astroapi::Categories::BaseCategory

Instance Method Details

#get_chinese_horoscope(request) ⇒ Hash

Get Chinese horoscope

Parameters:

  • request (Hash)

    Birth data for BaZi

Returns:

  • (Hash)

    Chinese horoscope



133
134
135
# File 'lib/astroapi/categories/horoscope.rb', line 133

def get_chinese_horoscope(request)
  http.post(build_url('chinese', 'bazi'), body: request)
end

#get_personal_daily_horoscope(request) ⇒ Hash

Get personalized daily horoscope

Parameters:

  • request (Hash)

    Subject birth data

Returns:

  • (Hash)

    Personalized daily horoscope



13
14
15
16
# File 'lib/astroapi/categories/horoscope.rb', line 13

def get_personal_daily_horoscope(request)
  Validators::SubjectValidator.validate!(request[:subject] || request['subject'])
  http.post(build_url('personal', 'daily'), body: request)
end

#get_personal_daily_horoscope_text(request) ⇒ Hash

Get personalized daily horoscope text

Parameters:

  • request (Hash)

    Subject birth data

Returns:

  • (Hash)

    Formatted horoscope text



21
22
23
24
# File 'lib/astroapi/categories/horoscope.rb', line 21

def get_personal_daily_horoscope_text(request)
  Validators::SubjectValidator.validate!(request[:subject] || request['subject'])
  http.post(build_url('personal', 'daily', 'text'), body: request)
end

#get_personal_monthly_horoscope(request) ⇒ Hash

Get personalized monthly horoscope

Parameters:

  • request (Hash)

    Subject birth data

Returns:

  • (Hash)

    Personalized monthly horoscope



101
102
103
104
# File 'lib/astroapi/categories/horoscope.rb', line 101

def get_personal_monthly_horoscope(request)
  Validators::SubjectValidator.validate!(request[:subject] || request['subject'])
  http.post(build_url('personal', 'monthly'), body: request)
end

#get_personal_monthly_horoscope_text(request) ⇒ Hash

Get personalized monthly horoscope text

Parameters:

  • request (Hash)

    Subject birth data

Returns:

  • (Hash)

    Formatted monthly horoscope text



109
110
111
112
# File 'lib/astroapi/categories/horoscope.rb', line 109

def get_personal_monthly_horoscope_text(request)
  Validators::SubjectValidator.validate!(request[:subject] || request['subject'])
  http.post(build_url('personal', 'monthly', 'text'), body: request)
end

#get_personal_weekly_horoscope(request) ⇒ Hash

Get personalized weekly horoscope

Parameters:

  • request (Hash)

    Subject birth data

Returns:

  • (Hash)

    Personalized weekly horoscope



85
86
87
88
# File 'lib/astroapi/categories/horoscope.rb', line 85

def get_personal_weekly_horoscope(request)
  Validators::SubjectValidator.validate!(request[:subject] || request['subject'])
  http.post(build_url('personal', 'weekly'), body: request)
end

#get_personal_weekly_horoscope_text(request) ⇒ Hash

Get personalized weekly horoscope text

Parameters:

  • request (Hash)

    Subject birth data

Returns:

  • (Hash)

    Formatted weekly horoscope text



93
94
95
96
# File 'lib/astroapi/categories/horoscope.rb', line 93

def get_personal_weekly_horoscope_text(request)
  Validators::SubjectValidator.validate!(request[:subject] || request['subject'])
  http.post(build_url('personal', 'weekly', 'text'), body: request)
end

#get_personal_yearly_horoscope(request) ⇒ Hash

Get personalized yearly horoscope

Parameters:

  • request (Hash)

    Subject birth data

Returns:

  • (Hash)

    Personalized yearly horoscope



117
118
119
120
# File 'lib/astroapi/categories/horoscope.rb', line 117

def get_personal_yearly_horoscope(request)
  Validators::SubjectValidator.validate!(request[:subject] || request['subject'])
  http.post(build_url('personal', 'yearly'), body: request)
end

#get_personal_yearly_horoscope_text(request) ⇒ Hash

Get personalized yearly horoscope text

Parameters:

  • request (Hash)

    Subject birth data

Returns:

  • (Hash)

    Formatted yearly horoscope text



125
126
127
128
# File 'lib/astroapi/categories/horoscope.rb', line 125

def get_personal_yearly_horoscope_text(request)
  Validators::SubjectValidator.validate!(request[:subject] || request['subject'])
  http.post(build_url('personal', 'yearly', 'text'), body: request)
end

#get_sign_daily_horoscope(request) ⇒ Hash

Get sign daily horoscope

Parameters:

  • request (Hash)

    Sun sign and date

Returns:

  • (Hash)

    Daily horoscope by sun sign



29
30
31
# File 'lib/astroapi/categories/horoscope.rb', line 29

def get_sign_daily_horoscope(request)
  http.post(build_url('sign', 'daily'), body: request)
end

#get_sign_daily_horoscope_text(request) ⇒ Hash

Get sign daily horoscope text

Parameters:

  • request (Hash)

    Sun sign and date

Returns:

  • (Hash)

    Formatted daily text



36
37
38
# File 'lib/astroapi/categories/horoscope.rb', line 36

def get_sign_daily_horoscope_text(request)
  http.post(build_url('sign', 'daily', 'text'), body: request)
end

#get_sign_monthly_horoscope(request) ⇒ Hash

Get sign monthly horoscope

Parameters:

  • request (Hash)

    Sun sign and month

Returns:

  • (Hash)

    Monthly horoscope by sun sign



57
58
59
# File 'lib/astroapi/categories/horoscope.rb', line 57

def get_sign_monthly_horoscope(request)
  http.post(build_url('sign', 'monthly'), body: request)
end

#get_sign_monthly_horoscope_text(request) ⇒ Hash

Get sign monthly horoscope text

Parameters:

  • request (Hash)

    Sun sign and month

Returns:

  • (Hash)

    Formatted monthly text



64
65
66
# File 'lib/astroapi/categories/horoscope.rb', line 64

def get_sign_monthly_horoscope_text(request)
  http.post(build_url('sign', 'monthly', 'text'), body: request)
end

#get_sign_weekly_horoscope(request) ⇒ Hash

Get sign weekly horoscope

Parameters:

  • request (Hash)

    Sun sign and week

Returns:

  • (Hash)

    Weekly horoscope by sun sign



43
44
45
# File 'lib/astroapi/categories/horoscope.rb', line 43

def get_sign_weekly_horoscope(request)
  http.post(build_url('sign', 'weekly'), body: request)
end

#get_sign_weekly_horoscope_text(request) ⇒ Hash

Get sign weekly horoscope text

Parameters:

  • request (Hash)

    Sun sign and week

Returns:

  • (Hash)

    Formatted weekly text



50
51
52
# File 'lib/astroapi/categories/horoscope.rb', line 50

def get_sign_weekly_horoscope_text(request)
  http.post(build_url('sign', 'weekly', 'text'), body: request)
end

#get_sign_yearly_horoscope(request) ⇒ Hash

Get sign yearly horoscope

Parameters:

  • request (Hash)

    Sun sign and year

Returns:

  • (Hash)

    Yearly overview by sun sign



71
72
73
# File 'lib/astroapi/categories/horoscope.rb', line 71

def get_sign_yearly_horoscope(request)
  http.post(build_url('sign', 'yearly'), body: request)
end

#get_sign_yearly_horoscope_text(request) ⇒ Hash

Get sign yearly horoscope text

Parameters:

  • request (Hash)

    Sun sign and year

Returns:

  • (Hash)

    Formatted yearly text



78
79
80
# File 'lib/astroapi/categories/horoscope.rb', line 78

def get_sign_yearly_horoscope_text(request)
  http.post(build_url('sign', 'yearly', 'text'), body: request)
end