Class: Variable
Instance Method Summary
collapse
_find, #attributes=, find, #initialize, #node
Instance Method Details
#downloadable? ⇒ Boolean
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'app/models/variable.rb', line 44
def downloadable?
if parent
return parent.entity.downloadable?
else
da = true
references_tmp.each{|v|
unless v.downloadable?
da = false
break
end
}
return da
end
end
|
#fname ⇒ Object
23
24
25
26
27
28
29
30
31
|
# File 'app/models/variable.rb', line 23
def fname
if node.file
node.add_prefix(node.file)
elsif (acs = actual_files).length > 0
acs.collect{|ac| node.add_prefix(ac.path) }
else
raise "[BUG]"
end
end
|
#gphys ⇒ Object
33
34
35
|
# File 'app/models/variable.rb', line 33
def gphys
NumRu::GPhys::IO.open(fname, vname)
end
|
#references_tmp ⇒ Object
37
38
39
40
41
42
|
# File 'app/models/variable.rb', line 37
def references_tmp
unless @new_record
raise "Cannot #call references_tmp for saved data. Use references instead"
end
@references_tmp ||= Array.new
end
|
#vname ⇒ Object
15
16
17
18
19
20
21
|
# File 'app/models/variable.rb', line 15
def vname
if vn = node.file
return node.path.sub(/#{vn}\//,"")
else
return name
end
end
|