Class: Flickr::Note

Inherits:
Object
  • Object
show all
Defined in:
lib/flickr/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, w, h, text, flickr = nil) ⇒ Note

Returns a new instance of Note.



635
636
637
638
639
640
641
642
# File 'lib/flickr/base.rb', line 635

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_idObject

Returns the value of attribute author_id.



634
635
636
# File 'lib/flickr/base.rb', line 634

def author_id
  @author_id
end

#hObject

Returns the value of attribute h.



634
635
636
# File 'lib/flickr/base.rb', line 634

def h
  @h
end

#idObject

Returns the value of attribute id.



634
635
636
# File 'lib/flickr/base.rb', line 634

def id
  @id
end

#photoObject

Returns the value of attribute photo.



634
635
636
# File 'lib/flickr/base.rb', line 634

def photo
  @photo
end

#textObject

Returns the value of attribute text.



634
635
636
# File 'lib/flickr/base.rb', line 634

def text
  @text
end

#wObject

Returns the value of attribute w.



634
635
636
# File 'lib/flickr/base.rb', line 634

def w
  @w
end

#xObject

Returns the value of attribute x.



634
635
636
# File 'lib/flickr/base.rb', line 634

def x
  @x
end

#yObject

Returns the value of attribute y.



634
635
636
# File 'lib/flickr/base.rb', line 634

def y
  @y
end

Instance Method Details

#authorObject



644
# File 'lib/flickr/base.rb', line 644

def author() @author_id && @flickr.people.getInfo(@author_id) end

#from_xml(xml, photo = nil) ⇒ Object



646
647
648
649
650
651
652
653
654
# File 'lib/flickr/base.rb', line 646

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.author_id = att['author'] if att['author']
end