Class: LinkThumbnailer::URI
- Inherits:
-
Object
- Object
- LinkThumbnailer::URI
- Defined in:
- lib/link_thumbnailer/uri.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
Instance Method Summary collapse
-
#initialize(uri) ⇒ URI
constructor
A new instance of URI.
- #to_s ⇒ Object
- #valid? ⇒ Boolean
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
#attribute ⇒ Object (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_s ⇒ Object
14 15 16 |
# File 'lib/link_thumbnailer/uri.rb', line 14 def to_s attribute end |
#valid? ⇒ Boolean
10 11 12 |
# File 'lib/link_thumbnailer/uri.rb', line 10 def valid? !!(attribute =~ ::URI::regexp) end |