Class: XForms::XPathRef

Inherits:
Object show all
Defined in:
lib/xforms/control.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#formObject

Returns the value of attribute form.



10
11
12
# File 'lib/xforms/control.rb', line 10

def form
  @form
end

#pathObject

Returns the value of attribute path.



11
12
13
# File 'lib/xforms/control.rb', line 11

def path
  @path
end

Instance Method Details

#dyn_valueObject



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

#nowObject



26
27
28
# File 'lib/xforms/control.rb', line 26

def now
  Time.now.utc.iso8601
end