Class: Trainer::LegacyXCResult::AbstractObject

Inherits:
Object
  • Object
show all
Defined in:
trainer/lib/trainer/legacy_xcresult.rb

Overview

Model attributes and relationships taken from running the following command: xcrun xcresulttool formatDescription –legacy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ AbstractObject

Returns a new instance of AbstractObject.



12
13
14
# File 'trainer/lib/trainer/legacy_xcresult.rb', line 12

def initialize(data)
  self.type = data["_type"]["_name"]
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



11
12
13
# File 'trainer/lib/trainer/legacy_xcresult.rb', line 11

def type
  @type
end

Instance Method Details

#fetch_value(data, key) ⇒ Object



16
17
18
# File 'trainer/lib/trainer/legacy_xcresult.rb', line 16

def fetch_value(data, key)
  return (data[key] || {})["_value"]
end

#fetch_values(data, key) ⇒ Object



20
21
22
# File 'trainer/lib/trainer/legacy_xcresult.rb', line 20

def fetch_values(data, key)
  return (data[key] || {})["_values"] || []
end