Module: Parameterization

Included in:
Duxml::Element
Defined in:
lib/re_duxml/element/parameterization.rb

Overview

methods to extend Dux::Object with methods needed to process parameterized XML content

Instance Method Summary collapse

Instance Method Details

#if=(condition) ⇒ Object

changes condition of this object’s existence



14
15
16
17
# File 'lib/re_duxml/element/parameterization.rb', line 14

def if=(condition)
  # check for valid conditional
  change_attr_value :if, condition
end

#if?Boolean

returns true if self is true or indeterminate (because condition is currently parameterized) returns false otherwise i.e. this node does not exist in this design build

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/re_duxml/element/parameterization.rb', line 8

def if?
  return true unless (if_str = self[:if])
  if_str.parameterized? || if_str == 'true' ? true : false
end