Class: LinkThumbnailer::URI

Inherits:
Object
  • Object
show all
Defined in:
lib/link_thumbnailer/uri.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ URI

Returns a new instance of URI.



6
7
8
# File 'lib/link_thumbnailer/uri.rb', line 6

def initialize(uri)
  @attribute = uri.to_s
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



4
5
6
# File 'lib/link_thumbnailer/uri.rb', line 4

def attribute
  @attribute
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/link_thumbnailer/uri.rb', line 14

def to_s
  attribute
end

#valid?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/link_thumbnailer/uri.rb', line 10

def valid?
  !!(attribute =~ ::URI::regexp)
end