Class: Ephemeris::Zodiac::Orb
- Inherits:
-
Object
- Object
- Ephemeris::Zodiac::Orb
- Defined in:
- lib/ephemeris/zodiac/orb.rb
Instance Attribute Summary collapse
-
#range ⇒ Object
Returns the value of attribute range.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #cover?(degrees_difference) ⇒ Boolean
-
#initialize(range, target) ⇒ Orb
constructor
A new instance of Orb.
Constructor Details
#initialize(range, target) ⇒ Orb
Returns a new instance of Orb.
5 6 7 |
# File 'lib/ephemeris/zodiac/orb.rb', line 5 def initialize(range, target) @range, @target = range, target end |
Instance Attribute Details
#range ⇒ Object
Returns the value of attribute range.
3 4 5 |
# File 'lib/ephemeris/zodiac/orb.rb', line 3 def range @range end |
#target ⇒ Object
Returns the value of attribute target.
3 4 5 |
# File 'lib/ephemeris/zodiac/orb.rb', line 3 def target @target end |
Instance Method Details
#cover?(degrees_difference) ⇒ Boolean
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ephemeris/zodiac/orb.rb', line 9 def cover?( degrees_difference ) cover = false if @range.is_a? Range degrees_difference.each do |degrees| cover = true if @range.cover?( @target.position + degrees ) end elsif @range.is_a? Array @range.each do |part| degrees_difference.each do |degrees| cover = true if part.cover?( @target.position + degrees ) end end end return cover end |