Class: Magpie::Author
- Inherits:
-
Object
- Object
- Magpie::Author
- Defined in:
- lib/magpie/author.rb
Instance Attribute Summary collapse
-
#image_uri ⇒ Object
readonly
Returns the value of attribute image_uri.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Author
constructor
A new instance of Author.
- #inspect ⇒ Object
Constructor Details
#initialize(xml) ⇒ Author
Returns a new instance of Author.
8 9 10 11 12 |
# File 'lib/magpie/author.rb', line 8 def initialize(xml) @name = xml.search('author/name').inner_html @uri = xml.search('author/uri').inner_html @image_uri = xml.search('link[@rel="image"]').attr('href') end |
Instance Attribute Details
#image_uri ⇒ Object (readonly)
Returns the value of attribute image_uri.
6 7 8 |
# File 'lib/magpie/author.rb', line 6 def image_uri @image_uri end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/magpie/author.rb', line 6 def name @name end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
6 7 8 |
# File 'lib/magpie/author.rb', line 6 def uri @uri end |
Instance Method Details
#inspect ⇒ Object
14 15 16 |
# File 'lib/magpie/author.rb', line 14 def inspect "#<#{self.class}:#{object_id}>" end |