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.



650
651
652
653
654
655
656
657
# File 'lib/flickr/base.rb', line 650

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.



649
650
651
# File 'lib/flickr/base.rb', line 649

def author_id
  @author_id
end

#hObject

Returns the value of attribute h.



649
650
651
# File 'lib/flickr/base.rb', line 649

def h
  @h
end

#idObject

Returns the value of attribute id.



649
650
651
# File 'lib/flickr/base.rb', line 649

def id
  @id
end

#photoObject

Returns the value of attribute photo.



649
650
651
# File 'lib/flickr/base.rb', line 649

def photo
  @photo
end

#textObject

Returns the value of attribute text.



649
650
651
# File 'lib/flickr/base.rb', line 649

def text
  @text
end

#wObject

Returns the value of attribute w.



649
650
651
# File 'lib/flickr/base.rb', line 649

def w
  @w
end

#xObject

Returns the value of attribute x.



649
650
651
# File 'lib/flickr/base.rb', line 649

def x
  @x
end

#yObject

Returns the value of attribute y.



649
650
651
# File 'lib/flickr/base.rb', line 649

def y
  @y
end

Class Method Details

.from_xml(xml, photo = nil) ⇒ Object



661
662
663
664
665
666
667
668
669
# File 'lib/flickr/base.rb', line 661

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



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

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