Conditions | 5 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
1 | require 'jsondoc' |
||
29 | |||
30 | def inflateNames() |
||
31 | dAssetState = { |
||
32 | 0 => 'Future', |
||
33 | 64 => 'Active', |
||
34 | 128 => 'Closed', |
||
35 | 200 => 'Template (Dead)', |
||
36 | 208 => 'Broken Down (Dead)', |
||
37 | 255 => 'Deleted (Dead)' |
||
38 | } |
||
39 | if @dDocument.has_key?(:AssetState) |
||
40 | sAssetState = @dDocument[:AssetState] |
||
41 | if sAssetState.is_a?(String) && sAssetState =~ /^[0-9]+$/ |
||
42 | iAssetState = sAssetState.to_i |
||
43 | if dAssetState.has_key?(iAssetState) |
||
44 | sAssetStateName = dAssetState[iAssetState] |
||
45 | self.setProp(:'AssetState.Name',sAssetStateName) |
||
46 | end |
||
47 | end |
||
48 | end |
||
49 | end |
||
52 |