lib/fat_period/period.rb
# Return the Period that is the intersection of self with `other` or nil if
# there is no intersection.
#
# @example
#   Period.parse('2015-3Q') & Period.parse('2015-2Q') #=> nil
#   Period.parse('2015') & Period.parse('2015-2Q')    #=> Period(2015-2Q)
#   pp1 = Period.parse_phrase('from 2015 to 2015-3Q') #=> Period(2015-01-01..2015-09-30)
#   pp2 = Period.parse_phrase('from 2015-2H')         #=> Period(2015-07-01..2015-12-31)
#   pp1 & pp2                                         #=> Period(2015-07-01..2015-09-30)
#
# @param other [Period] other Period
# @return [Period, nil] self intersect `other`?
Return the Period that is the intersection of self with `other` or nil if
there is no intersection.
Return the Period that is the intersection of self with ` other ` or nil if there is no intersection .
def intersection(other)
    result = to_range.intersection(other.to_range)
    if result.nil?
      nil
    else
      Period.new(result.first, result.last)
    end
  end
def intersection ( other ) result = to_range . intersection ( other . to_range ) if result . nil? nil else Period . new ( result . first , result . last ) end end
Return the Period that is the intersection of self with `other` or nil if
there is no intersection.
Return the Period that is the intersection of self with ` other ` or nil if there is no intersection .
None
Period, nil
other
None
example
None