Class: URI::Generic

Inherits:
Object
  • Object
show all
Defined in:
lib/xapian/indexer/extensions.rb

Instance Method Summary collapse

Instance Method Details

#absolute_path?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/xapian/indexer/extensions.rb', line 19

def absolute_path?
	path.match('^/')
end

#merge0(oth) ⇒ Object

Behavior in 1.8.7 seems to be broken…?



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/xapian/indexer/extensions.rb', line 28

def merge0(oth)
	case oth
	when Generic
	when String
		oth = URI.parse(oth)
	else
		raise ArgumentError, "bad argument(expected URI object or URI string)"
	end
	
	if oth.absolute?
		return oth, oth
	else
		return self.dup, oth
	end
end

#relative_path?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/xapian/indexer/extensions.rb', line 23

def relative_path?
	!absolute_path?
end