Class: WWW::Delicious::Bundle
- Defined in:
- lib/www/delicious/bundle.rb
Overview
Delicious Bundle
Represents a single Bundle element.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns value for
name
attribute. -
#tags ⇒ Object
The collection of
WWW::Delicious::Tags
.
Class Method Summary collapse
-
.from_rexml(element) ⇒ Object
Creates and returns new instance from a REXML
element
.
Instance Method Summary collapse
-
#to_s ⇒ Object
Returns a string representation of this Bundle.
Methods inherited from Element
Constructor Details
This class inherits a constructor from WWW::Delicious::Element
Instance Attribute Details
#name ⇒ Object
Returns value for name
attribute. Value is always normalized as lower string.
31 32 33 |
# File 'lib/www/delicious/bundle.rb', line 31 def name @name end |
#tags ⇒ Object
The collection of WWW::Delicious::Tags
.
34 35 36 |
# File 'lib/www/delicious/bundle.rb', line 34 def @tags end |
Class Method Details
.from_rexml(element) ⇒ Object
Creates and returns new instance from a REXML element
.
Implements Element#from_rexml.
59 60 61 62 63 64 65 66 |
# File 'lib/www/delicious/bundle.rb', line 59 def from_rexml(element) raise ArgumentError, "`element` expected to be a `REXML::Element`" unless element.kind_of? REXML::Element self.new do |instance| instance.name = element.if_attribute_value(:name) # FIXME: value must be converted to array of Tag instance. = element.if_attribute_value(:tags) { |value| value.split(' ') } end end |
Instance Method Details
#to_s ⇒ Object
Returns a string representation of this Bundle. In case name is nil this method will return an empty string.
47 48 49 |
# File 'lib/www/delicious/bundle.rb', line 47 def to_s name.to_s end |