Class: Magpie::Author

Inherits:
Object
  • Object
show all
Defined in:
lib/magpie/author.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_uriObject (readonly)

Returns the value of attribute image_uri.



6
7
8
# File 'lib/magpie/author.rb', line 6

def image_uri
  @image_uri
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/magpie/author.rb', line 6

def name
  @name
end

#uriObject (readonly)

Returns the value of attribute uri.



6
7
8
# File 'lib/magpie/author.rb', line 6

def uri
  @uri
end

Instance Method Details

#inspectObject



14
15
16
# File 'lib/magpie/author.rb', line 14

def inspect
  "#<#{self.class}:#{object_id}>"
end