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.



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

def initialize(form, path)
  @form = form
  @path = path
end

Instance Attribute Details

#formObject

Returns the value of attribute form.



8
9
10
# File 'lib/xforms/control.rb', line 8

def form
  @form
end

#pathObject

Returns the value of attribute path.



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

def path
  @path
end

Instance Method Details

#dyn_valueObject



16
17
18
# File 'lib/xforms/control.rb', line 16

def dyn_value
  form.model_instance.xpath(path, form.namespaces, self)
end

#itext(id) ⇒ Object



20
21
22
# File 'lib/xforms/control.rb', line 20

def itext id
  form.itext[I18n.locale.to_s][id] || ''
end