Class: RubyChartEngine::Charts::SolarReturn

Inherits:
BaseChart
  • Object
show all
Defined in:
lib/ruby_chart_engine/charts/solar_return.rb

Instance Attribute Summary collapse

Attributes inherited from BaseChart

#angles, #aspects, #coordinates, #datetime, #house_system, #houses, #julian_day, #planets, #timezone

Instance Method Summary collapse

Methods inherited from BaseChart

#to_json

Constructor Details

#initialize(natal_datetime:, return_year:, latitude:, longitude:, timezone: 'UTC', house_system: :placidus) ⇒ SolarReturn

Solar Return chart for a specific year Calculated for the moment the Sun returns to its natal position



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/ruby_chart_engine/charts/solar_return.rb', line 10

def initialize(natal_datetime:, return_year:, latitude:, longitude:, timezone: 'UTC', house_system: :placidus)
  # Get natal Sun position
  natal_chart_temp = Natal.new(
    datetime: natal_datetime,
    latitude: latitude,
    longitude: longitude,
    timezone: timezone
  )
  @natal_sun_longitude = natal_chart_temp.planets[:sun][:longitude]

  # Find the moment when Sun returns to natal position in the return year
  return_datetime = find_solar_return_time(natal_datetime, return_year, timezone)

  # Initialize with the solar return datetime
  super(
    datetime: return_datetime,
    latitude: latitude,
    longitude: longitude,
    timezone: timezone,
    house_system: house_system
  )
end

Instance Attribute Details

#natal_sun_longitudeObject (readonly)

Returns the value of attribute natal_sun_longitude.



6
7
8
# File 'lib/ruby_chart_engine/charts/solar_return.rb', line 6

def natal_sun_longitude
  @natal_sun_longitude
end

Instance Method Details

#to_hashObject



33
34
35
36
37
38
# File 'lib/ruby_chart_engine/charts/solar_return.rb', line 33

def to_hash
  super.merge(
    natal_sun_longitude: @natal_sun_longitude,
    chart_type: 'solar_return'
  )
end