Class: XForms::XPathRef
Instance Attribute Summary collapse
-
#form ⇒ Object
Returns the value of attribute form.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #dyn_value ⇒ Object
-
#initialize(form, path) ⇒ XPathRef
constructor
A new instance of XPathRef.
- #itext(id) ⇒ Object
- #now ⇒ Object
Constructor Details
#initialize(form, path) ⇒ XPathRef
Returns a new instance of XPathRef.
13 14 15 16 |
# File 'lib/xforms/control.rb', line 13 def initialize(form, path) @form = form @path = path end |
Instance Attribute Details
#form ⇒ Object
Returns the value of attribute form.
10 11 12 |
# File 'lib/xforms/control.rb', line 10 def form @form end |
#path ⇒ Object
Returns the value of attribute path.
11 12 13 |
# File 'lib/xforms/control.rb', line 11 def path @path end |
Instance Method Details
#dyn_value ⇒ Object
18 19 20 |
# File 'lib/xforms/control.rb', line 18 def dyn_value form.model_instance.xpath(path, form.namespaces, self) end |
#itext(id) ⇒ Object
22 23 24 |
# File 'lib/xforms/control.rb', line 22 def itext id form.itext[I18n.locale.to_s][id] || '' end |
#now ⇒ Object
26 27 28 |
# File 'lib/xforms/control.rb', line 26 def now Time.now.utc.iso8601 end |