lib/boom/item.rb in boom-0.2.4 vs lib/boom/item.rb in boom-0.3.0
- old
+ new
@@ -4,11 +4,10 @@
# a value. It doesn't know its parent relationship explicitly; the parent List
# object instead knows which Items it contains.
#
module Boom
class Item
-
# Public: the String name of the Item
attr_accessor :name
# Public: the String value of the Item
attr_accessor :value
@@ -52,11 +51,11 @@
def spacer
name.length > 15 ? '' : ' '*(15-name.length+1)
end
# Public: only return url part of value - if no url has been
- # detected returns value.
+ # detected it'll return the value.
#
# Returns a String which preferably is a URL.
def url
@url ||= value.split(/\s+/).detect { |v| v =~ %r{\A[a-z0-9]+:\S+}i } || value
end
@@ -65,8 +64,7 @@
#
# Returns a Hash of its data.
def to_hash
{ @name => @value }
end
-
end
-end
+end
\ No newline at end of file