Class: Flickr::Note
- Inherits:
-
Object
- Object
- Flickr::Note
- Defined in:
- lib/flickr/base.rb
Instance Attribute Summary collapse
-
#author_id ⇒ Object
Returns the value of attribute author_id.
-
#h ⇒ Object
Returns the value of attribute h.
-
#id ⇒ Object
Returns the value of attribute id.
-
#photo ⇒ Object
Returns the value of attribute photo.
-
#text ⇒ Object
Returns the value of attribute text.
-
#w ⇒ Object
Returns the value of attribute w.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #author ⇒ Object
- #from_xml(xml, photo = nil) ⇒ Object
-
#initialize(x, y, w, h, text, flickr = nil) ⇒ Note
constructor
A new instance of Note.
Constructor Details
#initialize(x, y, w, h, text, flickr = nil) ⇒ Note
Returns a new instance of Note.
633 634 635 636 637 638 639 640 |
# File 'lib/flickr/base.rb', line 633 def initialize(x, y, w, h, text, flickr = nil) @x = x @y = y @w = w @h = h @text = text @flickr = flickr end |
Instance Attribute Details
#author_id ⇒ Object
Returns the value of attribute author_id.
632 633 634 |
# File 'lib/flickr/base.rb', line 632 def @author_id end |
#h ⇒ Object
Returns the value of attribute h.
632 633 634 |
# File 'lib/flickr/base.rb', line 632 def h @h end |
#id ⇒ Object
Returns the value of attribute id.
632 633 634 |
# File 'lib/flickr/base.rb', line 632 def id @id end |
#photo ⇒ Object
Returns the value of attribute photo.
632 633 634 |
# File 'lib/flickr/base.rb', line 632 def photo @photo end |
#text ⇒ Object
Returns the value of attribute text.
632 633 634 |
# File 'lib/flickr/base.rb', line 632 def text @text end |
#w ⇒ Object
Returns the value of attribute w.
632 633 634 |
# File 'lib/flickr/base.rb', line 632 def w @w end |
#x ⇒ Object
Returns the value of attribute x.
632 633 634 |
# File 'lib/flickr/base.rb', line 632 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
632 633 634 |
# File 'lib/flickr/base.rb', line 632 def y @y end |
Instance Method Details
#author ⇒ Object
642 |
# File 'lib/flickr/base.rb', line 642 def () @author_id && @flickr.people.getInfo(@author_id) end |
#from_xml(xml, photo = nil) ⇒ Object
644 645 646 647 648 649 650 651 652 |
# File 'lib/flickr/base.rb', line 644 def from_xml(xml,photo=nil) att = xml.attributes note = Flickr::Note.new(att['x'].to_i,att['y'].to_i, att['w'].to_i,att['h'].to_i,xml.text, photo && photo.flickr) note.photo = photo note.id = att['id'] note. = att['author'] if att['author'] end |