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.



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_idObject

Returns the value of attribute author_id.



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

def author_id
  @author_id
end

#hObject

Returns the value of attribute h.



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

def h
  @h
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#photoObject

Returns the value of attribute photo.



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

def photo
  @photo
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end

#wObject

Returns the value of attribute w.



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

def w
  @w
end

#xObject

Returns the value of attribute x.



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

def x
  @x
end

#yObject

Returns the value of attribute y.



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

def y
  @y
end

Instance Method Details

#authorObject



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

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