Class: Puree::XMLExtractor::Resource

Inherits:
Base
  • Object
show all
Defined in:
lib/puree/xml_extractor/resource.rb

Overview

Resource XML extractor.

Instance Method Summary collapse

Methods inherited from Base

#xpath_query_for_multi_value, #xpath_query_for_single_value

Constructor Details

#initialize(xml) ⇒ Resource

Returns a new instance of Resource.



9
10
11
# File 'lib/puree/xml_extractor/resource.rb', line 9

def initialize(xml)
  super
end

Instance Method Details

#created_atTime?

Returns:

  • (Time, nil)


24
25
26
27
# File 'lib/puree/xml_extractor/resource.rb', line 24

def created_at
  xpath_result = xpath_query_for_single_value('/info/createdDate')
  Time.parse xpath_result if xpath_result
end

#created_byString?

Returns:

  • (String, nil)


19
20
21
# File 'lib/puree/xml_extractor/resource.rb', line 19

def created_by
  xpath_query_for_single_value('/info/createdBy')
end

#idString?

Returns:

  • (String, nil)


41
42
43
# File 'lib/puree/xml_extractor/resource.rb', line 41

def id
  xpath_query_for_single_value '/@pureId'
end

#modelPuree::Model::Resource subclass

Returns:



14
15
16
# File 'lib/puree/xml_extractor/resource.rb', line 14

def model
  
end

#modified_atTime?

Returns:

  • (Time, nil)


35
36
37
38
# File 'lib/puree/xml_extractor/resource.rb', line 35

def modified_at
  xpath_result = xpath_query_for_single_value('/info/modifiedDate')
  Time.parse xpath_result if xpath_result
end

#modified_byString?

Returns:

  • (String, nil)


30
31
32
# File 'lib/puree/xml_extractor/resource.rb', line 30

def modified_by
  xpath_query_for_single_value('/info/modifiedBy')
end

#previous_uuidsArray<String>

Returns:

  • (Array<String>)


51
52
53
# File 'lib/puree/xml_extractor/resource.rb', line 51

def previous_uuids
  xpath_query_for_multi_value '/info/previousUuids/previousUuid'
end

#uuidString?

Returns:

  • (String, nil)


46
47
48
# File 'lib/puree/xml_extractor/resource.rb', line 46

def uuid
  xpath_query_for_single_value '/@uuid'
end