Class: AMEE::Admin::ItemDefinitionList
Instance Attribute Summary
Attributes inherited from Collection
#connection, #doc, #json, #pager, #response
Instance Method Summary
collapse
Methods inherited from Collection
#each_page, #each_page_without_v3, #fetch, #fetch_without_v3, #initialize, #parse_page, #v3
#load_xml_doc, #node_value, #xmlpathpreamble
Instance Method Details
#collectionpath ⇒ Object
8
9
10
|
# File 'lib/amee/item_definition.rb', line 8
def collectionpath
'/definitions/itemDefinitions'
end
|
#jsoncollector ⇒ Object
14
15
16
|
# File 'lib/amee/item_definition.rb', line 14
def jsoncollector
@doc['itemDefinitions']
end
|
11
12
13
|
# File 'lib/amee/item_definition.rb', line 11
def klass
ItemDefinition
end
|
#parse_json(p) ⇒ Object
21
22
23
24
25
26
|
# File 'lib/amee/item_definition.rb', line 21
def parse_json(p)
data = {}
data[:uid] = p['uid']
data[:name] = p['name']
data
end
|
#parse_xml(p) ⇒ Object
27
28
29
30
31
32
|
# File 'lib/amee/item_definition.rb', line 27
def parse_xml(p)
data = {}
data[:uid] = x '@uid',:doc=>p
data[:name] = x('Name',:doc=>p) || data[:uid]
data
end
|
#xmlcollectorpath ⇒ Object
17
18
19
|
# File 'lib/amee/item_definition.rb', line 17
def xmlcollectorpath
'/Resources/ItemDefinitionsResource/ItemDefinitions/ItemDefinition'
end
|