Class: PhotoTreeNode

Inherits:
TreeNode
  • Object
show all
Includes:
ObjectWithProperties
Defined in:
lib/ralbum/photo_tree/photo_tree_node.rb

Overview

phototree contiene una gerarchia di phototreenode

contiene una lista di photoitem

Instance Method Summary collapse

Methods included from ObjectWithProperties

#[], #[]=, #init_object_with_properties

Constructor Details

#initialize(dirname, parentPhotoTreeNode = nil) ⇒ PhotoTreeNode

Returns a new instance of PhotoTreeNode.



15
16
17
18
# File 'lib/ralbum/photo_tree/photo_tree_node.rb', line 15

def initialize( dirname, parentPhotoTreeNode = nil )
  super( dirname, parentPhotoTreeNode )
  init_object_with_properties
end

Instance Method Details

#to_sObject



20
21
22
23
24
25
26
# File 'lib/ralbum/photo_tree/photo_tree_node.rb', line 20

def to_s
  if self['title'] and not self['title'].empty?
    "'#{name}'" + ": '" + self['title'] +"'"
  else
    "'#{name}'"
  end
end

#write_xml(xml_el) ⇒ Object

configurations



31
32
33
34
35
36
37
38
39
40
# File 'lib/ralbum/photo_tree/photo_tree_node.rb', line 31

def write_xml( xml_el )    
  xml_album = xml_el.add_element( "album" )
  xml_album.add_element("title").text = name
  xml_album.add_element("thumbnail")
  xml_album.add_element("shortdesc")
  xml_album.add_element("longdesc")
  xml_album.add_element("date")
  xml_album.add_element("order")
  xml_album
end