lib/ruote/exp/ro_attributes.rb in ruote-2.1.10 vs lib/ruote/exp/ro_attributes.rb in ruote-2.1.11
- old
+ new
@@ -58,11 +58,11 @@
v = if v == nil
default
elsif escape
v
else
- Ruote.dosub(v, self, workitem)
+ @context.dollar_sub.s(v, self, workitem)
end
v = v.to_s if v and string
v
@@ -128,11 +128,11 @@
# set "f:${v:field_name}" => "${v:that_variable}"
#
def expand_atts (opts={})
attributes.keys.inject({}) { |r, k|
- kk = Ruote.dosub(k, self, h.applied_workitem)
+ kk = @context.dollar_sub.s(k, self, h.applied_workitem)
r[kk] = attribute(k, h.applied_workitem, opts)
r
}
end
@@ -150,21 +150,23 @@
#
def attribute_text (workitem=h.applied_workitem)
text = attributes.keys.find { |k| attributes[k] == nil }
- Ruote.dosub(text.to_s, self, workitem)
+ @context.dollar_sub.s(text.to_s, self, workitem)
end
protected
def determine_tos
[ attribute(:to_v) || attribute(:to_var) || attribute(:to_variable),
attribute(:to_f) || attribute(:to_fld) || attribute(:to_field) ]
end
+ # Val and Value (Sense and Sensibility ?)
+ #
VV = %w[ val value ]
def s_cartesian (a0, a1)
a0.inject([]) { |a, e0| a + a1.collect { |e1| "#{e0}_#{e1}" } }
@@ -180,14 +182,9 @@
k = attribute(k, h.applied_workitem, att_options)
lookup_variable(k)
elsif k = has_att(*flds)
-
- #k = attribute(k, @applied_workitem, att_options)
-
- #@applied_workitem.attributes[k.to_s] ||
- #@applied_workitem.attributes[k.to_s.to_sym]
k = attribute(k, h.applied_workitem, att_options)
h.applied_workitem['fields'][k]
# TODO : what about leveraging workitem#lookup ?