Class: RubyChartEngine::Charts::Composite
- Defined in:
- lib/ruby_chart_engine/charts/composite.rb
Instance Attribute Summary collapse
-
#chart1 ⇒ Object
readonly
Returns the value of attribute chart1.
-
#chart2 ⇒ Object
readonly
Returns the value of attribute chart2.
Attributes inherited from BaseChart
#angles, #aspects, #coordinates, #datetime, #house_system, #houses, #julian_day, #planets, #timezone
Instance Method Summary collapse
-
#initialize(chart1_params:, chart2_params:, house_system: :placidus) ⇒ Composite
constructor
Composite chart - midpoint chart between two natal charts.
- #to_hash ⇒ Object
Methods inherited from BaseChart
Constructor Details
#initialize(chart1_params:, chart2_params:, house_system: :placidus) ⇒ Composite
Composite chart - midpoint chart between two natal charts
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ruby_chart_engine/charts/composite.rb', line 9 def initialize(chart1_params:, chart2_params:, house_system: :placidus) # Create the two base charts @chart1 = Natal.new(**chart1_params) @chart2 = Natal.new(**chart2_params) # Calculate composite datetime and location composite_datetime = calculate_midpoint_datetime composite_coords = calculate_midpoint_coordinates # Initialize with composite parameters super( datetime: composite_datetime, latitude: composite_coords[:latitude], longitude: composite_coords[:longitude], timezone: chart1_params[:timezone] || 'UTC', house_system: house_system ) end |
Instance Attribute Details
#chart1 ⇒ Object (readonly)
Returns the value of attribute chart1.
6 7 8 |
# File 'lib/ruby_chart_engine/charts/composite.rb', line 6 def chart1 @chart1 end |
#chart2 ⇒ Object (readonly)
Returns the value of attribute chart2.
6 7 8 |
# File 'lib/ruby_chart_engine/charts/composite.rb', line 6 def chart2 @chart2 end |
Instance Method Details
#to_hash ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/ruby_chart_engine/charts/composite.rb', line 28 def to_hash super.merge( chart_type: 'composite', chart1_metadata: @chart1.to_hash[:metadata], chart2_metadata: @chart2.to_hash[:metadata] ) end |