Ruby 2.1.0 リファレンスマニュアル > ライブラリ一覧 > uriライブラリ > URI::Genericクラス > absolute

instance method URI::Generic#absolute

absolute -> bool[permalink][rdoc]
absolute? -> bool

自身に scheme が設定されているなら true を返します。そうでない場合は false を返します。

例:

p URI.parse('http://example.com/').absolute?    #=> true
p URI.parse('./').absolute?                     #=> false