Class: Vixen::Model::Snapshot

Inherits:
Base
  • Object
show all
Defined in:
lib/vixen/model/snapshot.rb

Instance Attribute Summary

Attributes inherited from Base

#handle

Instance Method Summary collapse

Methods inherited from Base

finalize, #get_string_property, #initialize

Constructor Details

This class inherits a constructor from Vixen::Model::Base

Instance Method Details

#all_childrenObject



29
30
31
32
# File 'lib/vixen/model/snapshot.rb', line 29

def all_children
  childs = children
  (childs + childs.map {|child| child.all_children}).flatten
end

#childrenObject



25
26
27
# File 'lib/vixen/model/snapshot.rb', line 25

def children
  Vixen::Bridge.get_children(handle)
end

#descriptionObject



9
10
11
12
# File 'lib/vixen/model/snapshot.rb', line 9

def description
  return @description unless @description.nil?
  @description = get_string_property Vixen::Constants::VixPropertyId[:snapshot_description]
end

#display_nameObject



4
5
6
7
# File 'lib/vixen/model/snapshot.rb', line 4

def display_name
  return @display_name unless @display_name.nil?
  @display_name = get_string_property Vixen::Constants::VixPropertyId[:snapshot_displayname]
end

#full_nameObject



20
21
22
23
# File 'lib/vixen/model/snapshot.rb', line 20

def full_name
  root = parent ? parent.full_name : File::SEPARATOR
  File.join(root, display_name)
end

#parentObject



14
15
16
17
18
# File 'lib/vixen/model/snapshot.rb', line 14

def parent
  return @parent unless @parent.nil?
  parent_handle = Vixen::Bridge.get_parent handle
  @parent = parent_handle == Vixen::Constants::VixHandle[:invalid] ? nil : self.class.new(parent_handle)
end

#to_sObject



34
35
36
# File 'lib/vixen/model/snapshot.rb', line 34

def to_s
  display_name
end