Class: Flickr::Note

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Note.



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

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.



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

def author_id
  @author_id
end

#hObject

Returns the value of attribute h.



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

def h
  @h
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#photoObject

Returns the value of attribute photo.



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

def photo
  @photo
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end

#wObject

Returns the value of attribute w.



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

def w
  @w
end

#xObject

Returns the value of attribute x.



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

def x
  @x
end

#yObject

Returns the value of attribute y.



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

def y
  @y
end

Class Method Details

.from_xml(xml, photo = nil) ⇒ Object



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

def self.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

Instance Method Details

#authorObject



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

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