6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/apexgen/field/geolocation.rb', line 6
def format(name, o={})
name_title = name.titleize
o[:externalId] = o[:externalId] || 'false'
o[:trackHistory] = o[:trackHistory] || 'false'
o[:required] = o[:required] || 'false'
o[:displayLocationInDecimal] = o[:displayLocationInDecimal] || 'false'
o[:scale] = o[:scale] || '2'
"""
<fields>
<fullName>#{name_title.gsub(/\s/, '_')}__c</fullName>
<description>#{name_title} Description</description>
<displayLocationInDecimal>#{o[:displayLocationInDecimal]}</displayLocationInDecimal>
<externalId>#{o[:externalId]}</externalId>
<label>#{name_title}</label>
<required>#{o[:required]}</required>
<scale>#{o[:scale]}</scale>
<trackHistory>#{o[:trackHistory]}</trackHistory>
<type>Location</type>
</fields>
"""
end
|