def resolve_source(reference)
      if reference.only_fragment?
        # I found the spec wasn't fully clear on expected behaviour if a source
        # references a fragment that doesn't exist in it's current document
        # and just the root source. I'm assuming to be consistent with URI a
        # fragment only reference only references current JSON document. This
        # could be incorrect though.
        self
      else
        next_source_input = source_input.resolve_next(reference)
        source = document.source_for_source_input(next_source_input)
        source || self.class.new(next_source_input,
                                 document,
                                 reference_register,
                                 self)
      end
    end
def resolve_source(reference)
      if reference.only_fragment?
        # I found the spec wasn't fully clear on expected behaviour if a source
        # references a fragment that doesn't exist in it's current document
        # and just the root source. I'm assuming to be consistent with URI a
        # fragment only reference only references current JSON document. This
        # could be incorrect though.
        self
      else
        next_source_input = source_input.resolve_next(reference)
        source = document.source_for_source_input(next_source_input)
        source || self.class.new(next_source_input,
                                 document,
                                 reference_register,
                                 self)
      end
    end
Access/create the source object for a reference

 @param  [Reference] reference
 @return [Source]