Class: Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/lab_manager/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#deployedObject

Returns the value of attribute deployed.



28
29
30
# File 'lib/lab_manager/configuration.rb', line 28

def deployed
  @deployed
end

#idObject

Returns the value of attribute id.



26
27
28
# File 'lib/lab_manager/configuration.rb', line 26

def id
  @id
end

#nameObject

Returns the value of attribute name.



27
28
29
# File 'lib/lab_manager/configuration.rb', line 27

def name
  @name
end

Class Method Details

.parse(data) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/lab_manager/configuration.rb', line 5

def self.parse(data)

  configuration = Configuration.new

  if !data.__xmlele.empty?
    
    if data.__xmlele[0].first.name != "Configuration"
      data = data.__xmlele[0][1]
    end

    data_config = data["Configuration"]
    if data_config
      configuration.id = data_config["id"]
      configuration.name = data_config["name"]
      configuration.deployed = data_config["isDeployed"] == "true" ? true : false
    end
  end

  configuration
end